<!DOCTYPE html>
<html lang="en-US">
    <head>
        <title>Object::InsideOut - metacpan.org</title>
        <link rel="preload" as="fetch" href="https://metacpan.org/account/login_status" crossorigin="anonymous" />
        <link href="https://metacpan.org/_assets/b8ccceeed47a0652049703d99326a9cea4933443.css" rel="stylesheet" type="text/css">
        <script src="https://metacpan.org/_assets/6bfedafe2d7caa915b7d84f61b45936818e3242e.js" type="text/javascript" defer></script>
        <link rel="alternate" type="application/rss+xml" title="Recent CPAN Uploads of Object-InsideOut - MetaCPAN" href="https://metacpan.org/dist/Object-InsideOut/releases.rss" />
        <link rel="canonical" href="./Object::InsideOut.html" />
        <meta name="description" content="Comprehensive inside-out object support module" />
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5">
        <link rel="shortcut icon" href="https://metacpan.org/static/icons/favicon.ico">
        <link rel="apple-touch-icon" sizes="152x152" href="https://metacpan.org/static/icons/apple-touch-icon.png">
        <link rel="search" href="https://metacpan.org/static/opensearch.xml" type="application/opensearchdescription+xml" title="MetaCPAN">
        <script>
          (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
          (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
          })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

          (function(skey, ga_id){
            ga('create', ga_id, {
              siteSpeedSampleRate : 100,
              storage             : 'none',
              clientId            : localStorage.getItem(skey)
            });
            ga(function(tracker) {
              localStorage.setItem(skey, tracker.get('clientId'));
            });
            ga('send', 'pageview');
          })('ga:clientId', 'UA-27829474-1');
        </script>
<meta name="twitter:card"        content="summary" />
<meta name="twitter:url"         content="https://metacpan.org/pod/Object::InsideOut" />
<meta name="twitter:title"       content="Object::InsideOut" />
<meta name="twitter:description" content="" />
<meta name="twitter:site"        content="metacpan" />
    </head>
    <body>
        <nav class="navbar navbar-default" role="navigation">
            <div class="header-logo-large hidden-xs">
              <a href="https://metacpan.org/" tabindex="0">
                <svg class="logo" aria-label="MetaCPAN">
                  <use class="logo" href="/static/images/metacpan-logo.svg#logo" />
                </svg>
              </a>
            </div>
            <div class="header-logo-icon visible-xs">
              <a href="https://metacpan.org/">
                <svg class="logo" aria-label="MetaCPAN">
                  <use class="logo" href="/static/images/metacpan-logo.svg#dots" />
                </svg>
              </a>
            </div>
            <ul class="nav navbar-nav menu-items hidden-xs hidden-sm">
              <li><a href="https://metacpan.org/about">About</a></li>
              <li><a href="https://metacpan.org/about/sponsors">Sponsor</a></li>
              <li><a href="https://grep.metacpan.org/">grep::cpan</a></li>
              <li><a href="https://metacpan.org/recent">Recent</a></li>
              <li><a href="https://metacpan.org/about/faq">FAQ</a></li>
              <li><a href="https://metacpan.org/tools">Tools</a></li>
              <li><a href="https://fastapi.metacpan.org/">API</a></li>
            </ul>
            <ul class="nav navbar-nav navbar-right">
                <button type="button" class="searchbar-btn visible-xs visible-sm">
                    <i class="fa fa-search button-fa-icon"></i>
                </button>
                <form action="https://metacpan.org/search" class="searchbar-form visible-md visible-lg search-form form-horizontal">
                   <input type="hidden" name="size" id="metacpan_search-size" value="20">
                  <div class="form-group">
                      <div class="search-group">
                        <i class="fa fa-search"></i>
                        <input type="text" name="q" placeholder="Search the CPAN" size="41" autocorrect="off" autocapitalize="off" spellcheck="false" id="metacpan_search-input" class="form-control" value="">
                      </div>
                  </div>
                </form>
                    <li class="icon-slidepanel visible-xs visible-sm">
                      <button data-toggle="slidepanel" data-target=".slidepanel">
                        <span class="button-fa-icon">
                          <i class="fa fa-bars slidepanel-open"></i>
                          <i class="fa fa-times slidepanel-close"></i>
                        </span>
                      </button>
                    </li>
                <form action="https://metacpan.org/account/logout" method="POST" id="metacpan-logout"></form>
                <li class="dropdown logged_in" style="display: none;">
                    <button type="button" class="dropdown-toggle" data-toggle="dropdown">
                      <i class="fa fa-user button-fa-icon logged-in-icon" aria-hidden="true"></i>
                      <i class="fas fa-chevron-down"></i>
                    </button>
                    <ul class="dropdown-menu">
                        <li><a href="https://metacpan.org/account/identities">Identities</a></li>
                        <li><a href="https://metacpan.org/account/profile">Profile</a></li>
                        <li><a href="https://metacpan.org/account/favorite/list">Favorites</a></li>
                        <li>
                            <a href="./Object::InsideOut.html#" type="button" onclick="$('#metacpan-logout').submit(); return false">
                              Logout
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="dropdown logged_out" style="display: none;">
                    <button type="button" class="dropdown-toggle" data-toggle="dropdown">
                      <i class="fa fa-user button-fa-icon" aria-hidden="true"></i>
                      <i class="fas fa-chevron-down"></i>
                    </button>
                    <ul class="dropdown-menu">
                        <li>
                            <a href="https://metacpan.org/login/github">
                                <i class="fab fa-github fa-fw"></i>
                                GitHub
                            </a>
                        </li>
                        <li>
                            <a href="https://metacpan.org/login/twitter">
                                <i class="fab fa-twitter fa-fw"></i>
                                Twitter
                            </a>
                        </li>
                        <li>
                            <a href="https://metacpan.org/login/google">
                                <i class="fab fa-google fa-fw"></i>
                                Google
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="dropdown logged_placeholder">
                    <button>
                      <i class="fa fa-user button-fa-icon" aria-hidden="true"></i>
                    </button>
                </li>
            </ul>
        </nav>
        <div class="page-content ">
          <!--
          <div class="top-notify-banner">
            <i class="fas fa-info-circle"></i>
          </div>
          -->
          <nav class="sidebar">
            <div class="slidepanel">
              <ul class="nav-list ">
    <li class="nav-header no-margin-top">
      <div class="ttip" data-toggle="tooltip" data-placement="bottom" title="The date that this version of Object-InsideOut was released.">
      <span class="relatize">27 Nov 2018 03:43:51 UTC</span>
    </li>
  <li>
    Distribution: <a href="https://metacpan.org/dist/Object-InsideOut">Object-InsideOut</a>
  </li>
  <li>
    <a data-keyboard-shortcut="g s" href="https://metacpan.org/dist/Object-InsideOut/source/lib/Object/InsideOut/Autoload.pm">Source</a>
    (<a href="https://metacpan.org/dist/Object-InsideOut/source/lib/Object/InsideOut/Autoload.pm?raw=1">raw</a>)
  </li>
  <li>
    <a data-keyboard-shortcut="g p" href="https://metacpan.org/dist/Object-InsideOut/source/lib/Object/InsideOut.pod">Pod Source</a>
    (<a href="https://metacpan.org/dist/Object-InsideOut/source/lib/Object/InsideOut.pod?raw=1">raw</a>)
  </li>
  <li>
    <a data-keyboard-shortcut="g b" href="https://metacpan.org/dist/Object-InsideOut/source/lib/Object/InsideOut">Browse</a>
    (<a href="https://metacpan.org/dist/Object-InsideOut/source/lib/Object/InsideOut?raw=1">raw</a>)
  </li>
    <li>
      <a data-keyboard-shortcut="g c" href="https://metacpan.org/dist/Object-InsideOut/changes">Changes</a>
    </li>
    <li>
      <a class="nopopup" href="https://metacpan.org/dist/Object-InsideOut/contribute">How to Contribute</a>
    </li>
    <li>
      <a rel="noopener nofollow" data-keyboard-shortcut="g i" href="https://rt.cpan.org/Public/Dist/Display.html?Name=Object-InsideOut">Issues</a>
      (1)
    </li>
    <li>
      <a rel="noopener nofollow" href="http://matrix.cpantesters.org/?dist=Object-InsideOut+4.05" title="Matrix">Testers</a>
        <span title="(pass / fail / na)">(<a rel="noopener nofollow" href="https://www.cpantesters.org/distro/O/Object-InsideOut.html?oncpan=1&amp;distmat=1&amp;version=4.05&amp;grade=2" style="color: #090">3330</a> / <a rel="noopener nofollow" href="https://www.cpantesters.org/distro/O/Object-InsideOut.html?oncpan=1&amp;distmat=1&amp;version=4.05&amp;grade=3" style="color: #900">17</a> / <a rel="noopener nofollow" href="https://www.cpantesters.org/distro/O/Object-InsideOut.html?oncpan=1&amp;distmat=1&amp;version=4.05&amp;grade=4">0</a>)</span>
    </li>
    <li>
      <a rel="noopener nofollow" href="http://cpants.cpanauthors.org/release/JDHEDDEN/Object-InsideOut-4.05">Kwalitee</a>
    </li>
    <li>
      <div class="ttip" data-toggle="tooltip" data-placement="bottom" title="The # people with an indexing permission on Object-InsideOut who have released something to CPAN in the last 2 years (i.e. the # people likely able to release critical fixes in a timely manner)">
      Bus factor: 0
      </div>
    </li>
    <li>
      <a rel="noopener nofollow" href="http://cpancover.com/latest/Object-InsideOut-4.05/index.html">72.80% Coverage </a>
    </li>
    <li>
      License: perl_5
    </li>
    <li class="nav-header">Activity</li>
    <li>
<div class="activity-graph">
    <img src="https://metacpan.org/dist/Object-InsideOut/activity.svg?res=month" />
    <div class="comment">24 month</div>
</div>
    </li>
    <li class="nav-header">Tools</li>
    <li>
      <a itemprop="downloadUrl" href="https://cpan.metacpan.org/authors/id/J/JD/JDHEDDEN/Object-InsideOut-4.05.tar.gz">
      Download (<span itemprop="fileSize">129.22KB</span>)</a>
    </li>
    <li>
      <a href="https://explorer.metacpan.org/?url=%2Fmodule%2FJDHEDDEN%2FObject-InsideOut-4.05%2Flib%2FObject%2FInsideOut%2FAutoload.pm">
        MetaCPAN Explorer
      </a>
    </li>
    <li>
      <a href="https://metacpan.org/dist/Object-InsideOut/permissions">
        Permissions
      </a>
    </li>
    <li>
      <a href="https://metacpan.org/dist/Object-InsideOut/releases.rss">
        Subscribe to distribution
      </a>
    </li>
    <li>
      <button class="btn btn-link" data-toggle="modal" data-target="#metacpan_install-instructions-dialog">
        Install Instructions
      </button>
    </li>
    <li>
      <form action="https://metacpan.org/search">
        <input type="hidden" name="q" value="dist:Object-InsideOut">
        <input type="search" name="q" placeholder="Search distribution" class="form-control tool-bar-form">
        <input type="submit" style="display: none">
      </form>
    </li>
    <li>
      <form action="https://grep.metacpan.org/search">
        <input type="hidden" name="qd" value="Object-InsideOut">
        <input type="hidden" name="source" value="metacpan">
        <input type="search" name="q" placeholder="grep distribution" class="form-control tool-bar-form">
        <input type="submit" style="display: none">
     </form>
    </li>
    <li class="version-jump">
<select onchange="document.location.href=&#39;/release/&#39;+this.value+&#39;/view/lib/Object/InsideOut/Autoload.pm&#39;" class="form-control tool-bar-form">
  <option disabled selected>Jump to version</option>
<option
  disabled
  value="JDHEDDEN/Object-InsideOut-4.05"
>4.05
  (JDHEDDEN on 2018-11-27)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-4.04"
>4.04
  (JDHEDDEN on 2017-03-01)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-4.03"
>4.03
  (JDHEDDEN on 2017-02-26)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-4.02"
>4.02
  (JDHEDDEN on 2015-08-27)</option>
<optgroup label="BackPAN">'
<option
  
  value="JDHEDDEN/Object-InsideOut-4.01"
>4.01
  (JDHEDDEN on 2015-08-26)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.99"
>3.99
  (JDHEDDEN on 2015-08-22)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.98"
>3.98
  (JDHEDDEN on 2013-10-03)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.97"
>3.97
  (JDHEDDEN on 2012-11-15)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.96"
>3.96
  (JDHEDDEN on 2012-10-01)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.95"
>3.95
  (JDHEDDEN on 2012-07-24)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.94"
>3.94
  (JDHEDDEN on 2012-05-09)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.93"
>3.93
  (JDHEDDEN on 2012-04-09)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.92"
>3.92
  (JDHEDDEN on 2012-03-06)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.91"
>3.91
  (JDHEDDEN on 2012-02-22)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.89"
>3.89
  (JDHEDDEN on 2012-02-16)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.88"
>3.88
  (JDHEDDEN on 2012-01-26)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.87"
>3.87
  (JDHEDDEN on 2012-01-19)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.86"
>3.86
  (JDHEDDEN on 2012-01-19)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.85"
>3.85
  (JDHEDDEN on 2012-01-11)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.84"
>3.84
  (JDHEDDEN on 2011-10-11)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.83"
>3.83
  (JDHEDDEN on 2011-10-06)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.82"
>3.82
  (JDHEDDEN on 2011-09-27)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.81"
>3.81
  (JDHEDDEN on 2011-03-22)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.79"
>3.79
  (JDHEDDEN on 2010-12-24)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.78"
>3.78
  (JDHEDDEN on 2010-12-24)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.77"
>3.77
  (JDHEDDEN on 2010-12-21)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.76"
>3.76
  (JDHEDDEN on 2010-11-15)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.75"
>3.75
  (JDHEDDEN on 2010-11-09)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.74"
>3.74
  (JDHEDDEN on 2010-11-09)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.73"
>3.73
  (JDHEDDEN on 2010-11-08)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.72"
>3.72
  (JDHEDDEN on 2010-10-18)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.71"
>3.71
  (JDHEDDEN on 2010-10-13)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.69"
>3.69
  (JDHEDDEN on 2010-09-28)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.68"
>3.68
  (JDHEDDEN on 2010-09-23)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.67"
>3.67
  (JDHEDDEN on 2010-05-17)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.66"
>3.66
  (JDHEDDEN on 2010-05-14)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.65"
>3.65
  (JDHEDDEN on 2010-05-07)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.64"
>3.64
  (JDHEDDEN on 2010-03-10)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.63"
>3.63
  (JDHEDDEN on 2010-03-05)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.62"
>3.62
  (JDHEDDEN on 2010-03-04)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.61"
>3.61
  (JDHEDDEN on 2010-03-03)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.59"
>3.59
  (JDHEDDEN on 2010-03-03)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.58"
>3.58
  (JDHEDDEN on 2009-12-23)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.57"
>3.57
  (JDHEDDEN on 2009-11-05)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.56"
>3.56
  (JDHEDDEN on 2009-07-29)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.55"
>3.55
  (JDHEDDEN on 2009-05-08)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.54"
>3.54
  (JDHEDDEN on 2009-02-18)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.53"
>3.53
  (JDHEDDEN on 2009-02-18)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.52"
>3.52
  (JDHEDDEN on 2008-10-27)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.51"
>3.51
  (JDHEDDEN on 2008-10-23)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.49"
>3.49
  (JDHEDDEN on 2008-10-17)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.48"
>3.48
  (JDHEDDEN on 2008-10-16)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.47"
>3.47
  (JDHEDDEN on 2008-10-06)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.46"
>3.46
  (JDHEDDEN on 2008-10-03)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.45"
>3.45
  (JDHEDDEN on 2008-07-11)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.44"
>3.44
  (JDHEDDEN on 2008-07-11)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.43"
>3.43
  (JDHEDDEN on 2008-06-24)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.42"
>3.42
  (JDHEDDEN on 2008-06-13)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.41"
>3.41
  (JDHEDDEN on 2008-05-16)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.39"
>3.39
  (JDHEDDEN on 2008-03-10)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.38"
>3.38
  (JDHEDDEN on 2008-02-26)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.37"
>3.37
  (JDHEDDEN on 2008-02-19)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.36"
>3.36
  (JDHEDDEN on 2008-02-15)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.35"
>3.35
  (JDHEDDEN on 2007-12-21)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.34"
>3.34
  (JDHEDDEN on 2007-11-28)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.33"
>3.33
  (JDHEDDEN on 2007-11-09)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.32"
>3.32
  (JDHEDDEN on 2007-11-08)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.31"
>3.31
  (JDHEDDEN on 2007-11-08)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.29"
>3.29
  (JDHEDDEN on 2007-11-07)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.28"
>3.28
  (JDHEDDEN on 2007-11-07)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.27"
>3.27
  (JDHEDDEN on 2007-11-03)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.26"
>3.26
  (JDHEDDEN on 2007-09-18)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.25"
>3.25
  (JDHEDDEN on 2007-09-11)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.24"
>3.24
  (JDHEDDEN on 2007-09-11)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.23"
>3.23
  (JDHEDDEN on 2007-09-11)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.22"
>3.22
  (JDHEDDEN on 2007-09-07)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.21"
>3.21
  (JDHEDDEN on 2007-08-17)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.19"
>3.19
  (JDHEDDEN on 2007-06-26)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.18"
>3.18
  (JDHEDDEN on 2007-06-08)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.17"
>3.17
  (JDHEDDEN on 2007-05-11)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.16"
>3.16
  (JDHEDDEN on 2007-05-10)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.15"
>3.15
  (JDHEDDEN on 2007-05-10)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.14"
>3.14
  (JDHEDDEN on 2007-03-26)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.13"
>3.13
  (JDHEDDEN on 2007-03-19)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.12"
>3.12
  (JDHEDDEN on 2007-03-15)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.11"
>3.11
  (JDHEDDEN on 2007-02-19)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.09"
>3.09
  (JDHEDDEN on 2007-02-17)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.08"
>3.08
  (JDHEDDEN on 2006-12-27)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.07"
>3.07
  (JDHEDDEN on 2006-12-20)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.06"
>3.06
  (JDHEDDEN on 2006-12-11)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.05"
>3.05
  (JDHEDDEN on 2006-12-09)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.04"
>3.04
  (JDHEDDEN on 2006-12-08)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.03"
>3.03
  (JDHEDDEN on 2006-12-07)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.01"
>3.01
  (JDHEDDEN on 2006-12-05)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.25"
>2.25
  (JDHEDDEN on 2006-11-30)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.24"
>2.24
  (JDHEDDEN on 2006-11-27)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.23"
>2.23
  (JDHEDDEN on 2006-11-14)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.22"
>2.22
  (JDHEDDEN on 2006-11-14)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.21"
>2.21
  (JDHEDDEN on 2006-11-13)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.19"
>2.19
  (JDHEDDEN on 2006-11-02)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.18"
>2.18
  (JDHEDDEN on 2006-11-01)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.17"
>2.17
  (JDHEDDEN on 2006-10-31)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.16"
>2.16
  (JDHEDDEN on 2006-10-23)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.15"
>2.15
  (JDHEDDEN on 2006-10-20)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.14"
>2.14
  (JDHEDDEN on 2006-10-17)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.13"
>2.13
  (JDHEDDEN on 2006-10-17)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.12"
>2.12
  (JDHEDDEN on 2006-10-13)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.11"
>2.11
  (JDHEDDEN on 2006-10-13)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.09"
>2.09
  (JDHEDDEN on 2006-10-13)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.08"
>2.08
  (JDHEDDEN on 2006-10-11)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.07"
>2.07
  (JDHEDDEN on 2006-10-10)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.06"
>2.06
  (JDHEDDEN on 2006-10-09)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.05"
>2.05
  (JDHEDDEN on 2006-10-06)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.04"
>2.04
  (JDHEDDEN on 2006-10-03)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.03"
>2.03
  (JDHEDDEN on 2006-10-03)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.02"
>2.02
  (JDHEDDEN on 2006-09-23)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.01"
>2.01
  (JDHEDDEN on 2006-09-19)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.52"
>1.52
  (JDHEDDEN on 2006-09-01)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.51"
>1.51
  (JDHEDDEN on 2006-08-30)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.49"
>1.49
  (JDHEDDEN on 2006-08-08)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.48"
>1.48
  (JDHEDDEN on 2006-08-03)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.47"
>1.47
  (JDHEDDEN on 2006-08-01)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.46"
>1.46
  (JDHEDDEN on 2006-07-27)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.45"
>1.45
  (JDHEDDEN on 2006-06-27)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.44"
>1.44
  (JDHEDDEN on 2006-06-23)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.43"
>1.43
  (JDHEDDEN on 2006-06-23)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.42"
>1.42
  (JDHEDDEN on 2006-05-04)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.41"
>1.41
  (JDHEDDEN on 2006-04-27)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.39"
>1.39
  (JDHEDDEN on 2006-04-27)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.38"
>1.38
  (JDHEDDEN on 2006-03-06)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.37"
>1.37
  (JDHEDDEN on 2006-02-15)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.36"
>1.36
  (JDHEDDEN on 2006-02-08)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.35"
>1.35
  (JDHEDDEN on 2006-02-03)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.34"
>1.34
  (JDHEDDEN on 2006-02-01)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.33"
>1.33
  (JDHEDDEN on 2006-01-19)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.32"
>1.32
  (JDHEDDEN on 2006-01-18)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.31"
>1.31
  (JDHEDDEN on 2006-01-14)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.29"
>1.29
  (JDHEDDEN on 2006-01-09)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.28"
>1.28
  (JDHEDDEN on 2006-01-06)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.27"
>1.27
  (JDHEDDEN on 2005-12-28)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.26"
>1.26
  (JDHEDDEN on 2005-12-21)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.25"
>1.25
  (JDHEDDEN on 2005-12-21)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.24"
>1.24
  (JDHEDDEN on 2005-12-16)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.23"
>1.23
  (JDHEDDEN on 2005-12-12)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.22"
>1.22
  (JDHEDDEN on 2005-12-09)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.21"
>1.21
  (JDHEDDEN on 2005-12-08)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.19"
>1.19
  (JDHEDDEN on 2005-12-08)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.18"
>1.18
  (JDHEDDEN on 2005-12-07)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.17"
>1.17
  (JDHEDDEN on 2005-12-02)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.16"
>1.16
  (JDHEDDEN on 2005-12-01)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.15"
>1.15
  (JDHEDDEN on 2005-11-29)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.14"
>1.14
  (JDHEDDEN on 2005-11-23)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.13"
>1.13
  (JDHEDDEN on 2005-11-21)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.12"
>1.12
  (JDHEDDEN on 2005-11-21)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.11"
>1.11
  (JDHEDDEN on 2005-11-18)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.1"
>1.1
  (JDHEDDEN on 2005-11-17)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.05.00"
>1.05.00
  (JDHEDDEN on 2005-11-17)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.04.00"
>1.04.00
  (JDHEDDEN on 2005-11-16)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.03.00"
>1.03.00
  (JDHEDDEN on 2005-11-15)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.02.00"
>1.02.00
  (JDHEDDEN on 2005-11-15)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.01.00"
>1.01.00
  (JDHEDDEN on 2005-11-14)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.00.00"
>1.00.00
  (JDHEDDEN on 2005-11-11)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-0.07.00"
>0.07.00
  (JDHEDDEN on 2005-11-10)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-0.06.00"
>0.06.00
  (JDHEDDEN on 2005-11-03)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-0.05.00"
>0.05.00
  (JDHEDDEN on 2005-11-03)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-0.04.00"
>0.04.00
  (JDHEDDEN on 2005-11-02)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-0.03.00"
>0.03.00
  (JDHEDDEN on 2005-11-01)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-0.02.00"
>0.02.00
  (JDHEDDEN on 2005-10-31)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-0.01.00"
>0.01.00
  (JDHEDDEN on 2005-10-31)</option>
</optgroup>
</select>
    </li>
    <li class="version-diff">
<select onchange="document.location.href='/release/JDHEDDEN/Object-InsideOut-4.05/diff/' + encodeURIComponent(this.value) + '/lib/Object/InsideOut/Autoload.pm'
" class="form-control tool-bar-form">
  <option disabled selected>Diff with version</option>
<option
  disabled
  value="JDHEDDEN/Object-InsideOut-4.05"
>4.05
  (JDHEDDEN on 2018-11-27)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-4.04"
>4.04
  (JDHEDDEN on 2017-03-01)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-4.03"
>4.03
  (JDHEDDEN on 2017-02-26)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-4.02"
>4.02
  (JDHEDDEN on 2015-08-27)</option>
<optgroup label="BackPAN">'
<option
  
  value="JDHEDDEN/Object-InsideOut-4.01"
>4.01
  (JDHEDDEN on 2015-08-26)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.99"
>3.99
  (JDHEDDEN on 2015-08-22)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.98"
>3.98
  (JDHEDDEN on 2013-10-03)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.97"
>3.97
  (JDHEDDEN on 2012-11-15)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.96"
>3.96
  (JDHEDDEN on 2012-10-01)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.95"
>3.95
  (JDHEDDEN on 2012-07-24)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.94"
>3.94
  (JDHEDDEN on 2012-05-09)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.93"
>3.93
  (JDHEDDEN on 2012-04-09)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.92"
>3.92
  (JDHEDDEN on 2012-03-06)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.91"
>3.91
  (JDHEDDEN on 2012-02-22)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.89"
>3.89
  (JDHEDDEN on 2012-02-16)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.88"
>3.88
  (JDHEDDEN on 2012-01-26)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.87"
>3.87
  (JDHEDDEN on 2012-01-19)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.86"
>3.86
  (JDHEDDEN on 2012-01-19)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.85"
>3.85
  (JDHEDDEN on 2012-01-11)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.84"
>3.84
  (JDHEDDEN on 2011-10-11)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.83"
>3.83
  (JDHEDDEN on 2011-10-06)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.82"
>3.82
  (JDHEDDEN on 2011-09-27)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.81"
>3.81
  (JDHEDDEN on 2011-03-22)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.79"
>3.79
  (JDHEDDEN on 2010-12-24)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.78"
>3.78
  (JDHEDDEN on 2010-12-24)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.77"
>3.77
  (JDHEDDEN on 2010-12-21)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.76"
>3.76
  (JDHEDDEN on 2010-11-15)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.75"
>3.75
  (JDHEDDEN on 2010-11-09)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.74"
>3.74
  (JDHEDDEN on 2010-11-09)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.73"
>3.73
  (JDHEDDEN on 2010-11-08)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.72"
>3.72
  (JDHEDDEN on 2010-10-18)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.71"
>3.71
  (JDHEDDEN on 2010-10-13)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.69"
>3.69
  (JDHEDDEN on 2010-09-28)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.68"
>3.68
  (JDHEDDEN on 2010-09-23)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.67"
>3.67
  (JDHEDDEN on 2010-05-17)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.66"
>3.66
  (JDHEDDEN on 2010-05-14)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.65"
>3.65
  (JDHEDDEN on 2010-05-07)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.64"
>3.64
  (JDHEDDEN on 2010-03-10)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.63"
>3.63
  (JDHEDDEN on 2010-03-05)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.62"
>3.62
  (JDHEDDEN on 2010-03-04)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.61"
>3.61
  (JDHEDDEN on 2010-03-03)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.59"
>3.59
  (JDHEDDEN on 2010-03-03)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.58"
>3.58
  (JDHEDDEN on 2009-12-23)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.57"
>3.57
  (JDHEDDEN on 2009-11-05)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.56"
>3.56
  (JDHEDDEN on 2009-07-29)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.55"
>3.55
  (JDHEDDEN on 2009-05-08)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.54"
>3.54
  (JDHEDDEN on 2009-02-18)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.53"
>3.53
  (JDHEDDEN on 2009-02-18)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.52"
>3.52
  (JDHEDDEN on 2008-10-27)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.51"
>3.51
  (JDHEDDEN on 2008-10-23)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.49"
>3.49
  (JDHEDDEN on 2008-10-17)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.48"
>3.48
  (JDHEDDEN on 2008-10-16)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.47"
>3.47
  (JDHEDDEN on 2008-10-06)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.46"
>3.46
  (JDHEDDEN on 2008-10-03)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.45"
>3.45
  (JDHEDDEN on 2008-07-11)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.44"
>3.44
  (JDHEDDEN on 2008-07-11)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.43"
>3.43
  (JDHEDDEN on 2008-06-24)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.42"
>3.42
  (JDHEDDEN on 2008-06-13)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.41"
>3.41
  (JDHEDDEN on 2008-05-16)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.39"
>3.39
  (JDHEDDEN on 2008-03-10)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.38"
>3.38
  (JDHEDDEN on 2008-02-26)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.37"
>3.37
  (JDHEDDEN on 2008-02-19)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.36"
>3.36
  (JDHEDDEN on 2008-02-15)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.35"
>3.35
  (JDHEDDEN on 2007-12-21)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.34"
>3.34
  (JDHEDDEN on 2007-11-28)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.33"
>3.33
  (JDHEDDEN on 2007-11-09)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.32"
>3.32
  (JDHEDDEN on 2007-11-08)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.31"
>3.31
  (JDHEDDEN on 2007-11-08)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.29"
>3.29
  (JDHEDDEN on 2007-11-07)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.28"
>3.28
  (JDHEDDEN on 2007-11-07)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.27"
>3.27
  (JDHEDDEN on 2007-11-03)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.26"
>3.26
  (JDHEDDEN on 2007-09-18)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.25"
>3.25
  (JDHEDDEN on 2007-09-11)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.24"
>3.24
  (JDHEDDEN on 2007-09-11)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.23"
>3.23
  (JDHEDDEN on 2007-09-11)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.22"
>3.22
  (JDHEDDEN on 2007-09-07)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.21"
>3.21
  (JDHEDDEN on 2007-08-17)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.19"
>3.19
  (JDHEDDEN on 2007-06-26)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.18"
>3.18
  (JDHEDDEN on 2007-06-08)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.17"
>3.17
  (JDHEDDEN on 2007-05-11)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.16"
>3.16
  (JDHEDDEN on 2007-05-10)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.15"
>3.15
  (JDHEDDEN on 2007-05-10)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.14"
>3.14
  (JDHEDDEN on 2007-03-26)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.13"
>3.13
  (JDHEDDEN on 2007-03-19)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.12"
>3.12
  (JDHEDDEN on 2007-03-15)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.11"
>3.11
  (JDHEDDEN on 2007-02-19)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.09"
>3.09
  (JDHEDDEN on 2007-02-17)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.08"
>3.08
  (JDHEDDEN on 2006-12-27)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.07"
>3.07
  (JDHEDDEN on 2006-12-20)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.06"
>3.06
  (JDHEDDEN on 2006-12-11)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.05"
>3.05
  (JDHEDDEN on 2006-12-09)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.04"
>3.04
  (JDHEDDEN on 2006-12-08)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.03"
>3.03
  (JDHEDDEN on 2006-12-07)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.01"
>3.01
  (JDHEDDEN on 2006-12-05)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.25"
>2.25
  (JDHEDDEN on 2006-11-30)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.24"
>2.24
  (JDHEDDEN on 2006-11-27)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.23"
>2.23
  (JDHEDDEN on 2006-11-14)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.22"
>2.22
  (JDHEDDEN on 2006-11-14)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.21"
>2.21
  (JDHEDDEN on 2006-11-13)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.19"
>2.19
  (JDHEDDEN on 2006-11-02)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.18"
>2.18
  (JDHEDDEN on 2006-11-01)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.17"
>2.17
  (JDHEDDEN on 2006-10-31)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.16"
>2.16
  (JDHEDDEN on 2006-10-23)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.15"
>2.15
  (JDHEDDEN on 2006-10-20)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.14"
>2.14
  (JDHEDDEN on 2006-10-17)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.13"
>2.13
  (JDHEDDEN on 2006-10-17)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.12"
>2.12
  (JDHEDDEN on 2006-10-13)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.11"
>2.11
  (JDHEDDEN on 2006-10-13)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.09"
>2.09
  (JDHEDDEN on 2006-10-13)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.08"
>2.08
  (JDHEDDEN on 2006-10-11)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.07"
>2.07
  (JDHEDDEN on 2006-10-10)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.06"
>2.06
  (JDHEDDEN on 2006-10-09)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.05"
>2.05
  (JDHEDDEN on 2006-10-06)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.04"
>2.04
  (JDHEDDEN on 2006-10-03)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.03"
>2.03
  (JDHEDDEN on 2006-10-03)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.02"
>2.02
  (JDHEDDEN on 2006-09-23)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.01"
>2.01
  (JDHEDDEN on 2006-09-19)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.52"
>1.52
  (JDHEDDEN on 2006-09-01)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.51"
>1.51
  (JDHEDDEN on 2006-08-30)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.49"
>1.49
  (JDHEDDEN on 2006-08-08)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.48"
>1.48
  (JDHEDDEN on 2006-08-03)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.47"
>1.47
  (JDHEDDEN on 2006-08-01)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.46"
>1.46
  (JDHEDDEN on 2006-07-27)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.45"
>1.45
  (JDHEDDEN on 2006-06-27)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.44"
>1.44
  (JDHEDDEN on 2006-06-23)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.43"
>1.43
  (JDHEDDEN on 2006-06-23)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.42"
>1.42
  (JDHEDDEN on 2006-05-04)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.41"
>1.41
  (JDHEDDEN on 2006-04-27)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.39"
>1.39
  (JDHEDDEN on 2006-04-27)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.38"
>1.38
  (JDHEDDEN on 2006-03-06)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.37"
>1.37
  (JDHEDDEN on 2006-02-15)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.36"
>1.36
  (JDHEDDEN on 2006-02-08)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.35"
>1.35
  (JDHEDDEN on 2006-02-03)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.34"
>1.34
  (JDHEDDEN on 2006-02-01)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.33"
>1.33
  (JDHEDDEN on 2006-01-19)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.32"
>1.32
  (JDHEDDEN on 2006-01-18)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.31"
>1.31
  (JDHEDDEN on 2006-01-14)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.29"
>1.29
  (JDHEDDEN on 2006-01-09)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.28"
>1.28
  (JDHEDDEN on 2006-01-06)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.27"
>1.27
  (JDHEDDEN on 2005-12-28)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.26"
>1.26
  (JDHEDDEN on 2005-12-21)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.25"
>1.25
  (JDHEDDEN on 2005-12-21)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.24"
>1.24
  (JDHEDDEN on 2005-12-16)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.23"
>1.23
  (JDHEDDEN on 2005-12-12)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.22"
>1.22
  (JDHEDDEN on 2005-12-09)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.21"
>1.21
  (JDHEDDEN on 2005-12-08)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.19"
>1.19
  (JDHEDDEN on 2005-12-08)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.18"
>1.18
  (JDHEDDEN on 2005-12-07)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.17"
>1.17
  (JDHEDDEN on 2005-12-02)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.16"
>1.16
  (JDHEDDEN on 2005-12-01)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.15"
>1.15
  (JDHEDDEN on 2005-11-29)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.14"
>1.14
  (JDHEDDEN on 2005-11-23)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.13"
>1.13
  (JDHEDDEN on 2005-11-21)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.12"
>1.12
  (JDHEDDEN on 2005-11-21)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.11"
>1.11
  (JDHEDDEN on 2005-11-18)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.1"
>1.1
  (JDHEDDEN on 2005-11-17)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.05.00"
>1.05.00
  (JDHEDDEN on 2005-11-17)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.04.00"
>1.04.00
  (JDHEDDEN on 2005-11-16)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.03.00"
>1.03.00
  (JDHEDDEN on 2005-11-15)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.02.00"
>1.02.00
  (JDHEDDEN on 2005-11-15)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.01.00"
>1.01.00
  (JDHEDDEN on 2005-11-14)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.00.00"
>1.00.00
  (JDHEDDEN on 2005-11-11)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-0.07.00"
>0.07.00
  (JDHEDDEN on 2005-11-10)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-0.06.00"
>0.06.00
  (JDHEDDEN on 2005-11-03)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-0.05.00"
>0.05.00
  (JDHEDDEN on 2005-11-03)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-0.04.00"
>0.04.00
  (JDHEDDEN on 2005-11-02)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-0.03.00"
>0.03.00
  (JDHEDDEN on 2005-11-01)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-0.02.00"
>0.02.00
  (JDHEDDEN on 2005-10-31)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-0.01.00"
>0.01.00
  (JDHEDDEN on 2005-10-31)</option>
</optgroup>
</select>
    </li>

    <li>
<ul class="dependencies">
  <li class="nav-header">Dependencies</li>
  <li><a href="https://metacpan.org/pod/B" title="B" class="ellipsis">B</a></li>
  <li><a href="https://metacpan.org/pod/Config" title="Config" class="ellipsis">Config</a></li>
  <li><a href="https://metacpan.org/pod/Data::Dumper" title="Data::Dumper" class="ellipsis">Data::Dumper</a></li>
  <li><a href="https://metacpan.org/pod/Exception::Class" title="Exception::Class" class="ellipsis">Exception::Class</a></li>
  <li><a href="https://metacpan.org/pod/Scalar::Util" title="Scalar::Util" class="ellipsis">Scalar::Util</a></li>
  <li><a href="https://metacpan.org/pod/Test::More" title="Test::More" class="ellipsis">Test::More</a></li>
  <li><a href="https://metacpan.org/pod/attributes" title="attributes" class="ellipsis">attributes</a></li>
  <li><a href="https://metacpan.org/pod/overload" title="overload" class="ellipsis">overload</a></li>
  <li><a href="https://metacpan.org/pod/strict" title="strict" class="ellipsis">strict</a></li>
  <li><a href="https://metacpan.org/pod/warnings" title="warnings" class="ellipsis">warnings</a></li>
  <li><i class="ttip" title="dynamic_config enabled">and possibly others</i></li>
  <li>
    <hr>
  </li>
  <li>
    <a href="https://metacpan.org/module/Object::InsideOut/requires">Reverse dependencies</a>
  </li>
  <li>
    <a href="http://deps.cpantesters.org/?module=Object%3A%3AInsideOut">CPAN Testers List</a>
  </li>
  <li>
    <a href="https://cpandeps.grinnz.com/?dist=Object-InsideOut">Dependency graph</a>
  </li>
</ul>
    </li>
    <li class="nav-header">Permalinks</li>
    <li>
      <a href="https://metacpan.org/release/JDHEDDEN/Object-InsideOut-4.05/view/lib/Object/InsideOut/Autoload.pm">This version</a>
    </li>
    <li>
      <a href="./Object::InsideOut.html">Latest version</a>
    </li>
    <li>
<div class="plussers">
<div class="nav-header">++ed by:</div>
<div>
<a class="display-all" href="https://metacpan.org/author/XYF"><img src="https://www.gravatar.com/avatar/468b93184448908572ef5dc5c0924e76?d=identicon&amp;s=20" title="XYF" alt="XYF"></a>
<a class="display-all" href="https://metacpan.org/author/KES"><img src="https://www.gravatar.com/avatar/e8530f00b43b4f6a056f8ad4ee52ea47?d=identicon&amp;s=20" title="KES" alt="KES"></a>
</div>
<!-- Display counts of plussers-->
<div>
    <a href="https://metacpan.org/dist/Object-InsideOut/plussers">2 PAUSE users</a>
</div>
<div>
    3 non-PAUSE users
</div>
</div>
    </li>
    <li>
<div id="metacpan_contributors">
  <div>
    <button class="btn-link"
      onclick="$(this).hide(); $('#metacpan_contributors ul').slideDown(); return false;"
    >and 1 contributors</button>
  </div>
  <ul style="display: none">
    <li class="contributor"
    >
      Jerry D. Hedden &lt;jdhedden AT cpan DOT org&gt;
    </li>
  </ul>
</div>
    </li>
              </ul>
            </div>
          </nav>
          <div class="content-navigation">
<div class="breadcrumbs">
  <span>
    <a data-keyboard-shortcut="g a" rel="author" href="https://metacpan.org/author/JDHEDDEN" class="author-name">Jerry D. Hedden</a>
  </span>
  <span>&nbsp;/&nbsp;</span>
  <div class="release dist-release status-latest maturity-released">
    <span class="dropdown"><b class="caret"></b></span>
<select onchange="document.location.href=&#39;/release/&#39;+this.value+&#39;/view/lib/Object/InsideOut/Autoload.pm&#39;" class="">
<option
  selected
  value="JDHEDDEN/Object-InsideOut-4.05"
>4.05
  (JDHEDDEN on 2018-11-27)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-4.04"
>4.04
  (JDHEDDEN on 2017-03-01)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-4.03"
>4.03
  (JDHEDDEN on 2017-02-26)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-4.02"
>4.02
  (JDHEDDEN on 2015-08-27)</option>
<optgroup label="BackPAN">'
<option
  
  value="JDHEDDEN/Object-InsideOut-4.01"
>4.01
  (JDHEDDEN on 2015-08-26)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.99"
>3.99
  (JDHEDDEN on 2015-08-22)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.98"
>3.98
  (JDHEDDEN on 2013-10-03)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.97"
>3.97
  (JDHEDDEN on 2012-11-15)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.96"
>3.96
  (JDHEDDEN on 2012-10-01)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.95"
>3.95
  (JDHEDDEN on 2012-07-24)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.94"
>3.94
  (JDHEDDEN on 2012-05-09)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.93"
>3.93
  (JDHEDDEN on 2012-04-09)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.92"
>3.92
  (JDHEDDEN on 2012-03-06)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.91"
>3.91
  (JDHEDDEN on 2012-02-22)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.89"
>3.89
  (JDHEDDEN on 2012-02-16)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.88"
>3.88
  (JDHEDDEN on 2012-01-26)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.87"
>3.87
  (JDHEDDEN on 2012-01-19)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.86"
>3.86
  (JDHEDDEN on 2012-01-19)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.85"
>3.85
  (JDHEDDEN on 2012-01-11)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.84"
>3.84
  (JDHEDDEN on 2011-10-11)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.83"
>3.83
  (JDHEDDEN on 2011-10-06)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.82"
>3.82
  (JDHEDDEN on 2011-09-27)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.81"
>3.81
  (JDHEDDEN on 2011-03-22)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.79"
>3.79
  (JDHEDDEN on 2010-12-24)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.78"
>3.78
  (JDHEDDEN on 2010-12-24)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.77"
>3.77
  (JDHEDDEN on 2010-12-21)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.76"
>3.76
  (JDHEDDEN on 2010-11-15)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.75"
>3.75
  (JDHEDDEN on 2010-11-09)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.74"
>3.74
  (JDHEDDEN on 2010-11-09)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.73"
>3.73
  (JDHEDDEN on 2010-11-08)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.72"
>3.72
  (JDHEDDEN on 2010-10-18)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.71"
>3.71
  (JDHEDDEN on 2010-10-13)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.69"
>3.69
  (JDHEDDEN on 2010-09-28)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.68"
>3.68
  (JDHEDDEN on 2010-09-23)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.67"
>3.67
  (JDHEDDEN on 2010-05-17)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.66"
>3.66
  (JDHEDDEN on 2010-05-14)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.65"
>3.65
  (JDHEDDEN on 2010-05-07)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.64"
>3.64
  (JDHEDDEN on 2010-03-10)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.63"
>3.63
  (JDHEDDEN on 2010-03-05)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.62"
>3.62
  (JDHEDDEN on 2010-03-04)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.61"
>3.61
  (JDHEDDEN on 2010-03-03)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.59"
>3.59
  (JDHEDDEN on 2010-03-03)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.58"
>3.58
  (JDHEDDEN on 2009-12-23)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.57"
>3.57
  (JDHEDDEN on 2009-11-05)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.56"
>3.56
  (JDHEDDEN on 2009-07-29)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.55"
>3.55
  (JDHEDDEN on 2009-05-08)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.54"
>3.54
  (JDHEDDEN on 2009-02-18)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.53"
>3.53
  (JDHEDDEN on 2009-02-18)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.52"
>3.52
  (JDHEDDEN on 2008-10-27)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.51"
>3.51
  (JDHEDDEN on 2008-10-23)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.49"
>3.49
  (JDHEDDEN on 2008-10-17)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.48"
>3.48
  (JDHEDDEN on 2008-10-16)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.47"
>3.47
  (JDHEDDEN on 2008-10-06)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.46"
>3.46
  (JDHEDDEN on 2008-10-03)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.45"
>3.45
  (JDHEDDEN on 2008-07-11)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.44"
>3.44
  (JDHEDDEN on 2008-07-11)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.43"
>3.43
  (JDHEDDEN on 2008-06-24)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.42"
>3.42
  (JDHEDDEN on 2008-06-13)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.41"
>3.41
  (JDHEDDEN on 2008-05-16)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.39"
>3.39
  (JDHEDDEN on 2008-03-10)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.38"
>3.38
  (JDHEDDEN on 2008-02-26)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.37"
>3.37
  (JDHEDDEN on 2008-02-19)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.36"
>3.36
  (JDHEDDEN on 2008-02-15)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.35"
>3.35
  (JDHEDDEN on 2007-12-21)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.34"
>3.34
  (JDHEDDEN on 2007-11-28)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.33"
>3.33
  (JDHEDDEN on 2007-11-09)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.32"
>3.32
  (JDHEDDEN on 2007-11-08)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.31"
>3.31
  (JDHEDDEN on 2007-11-08)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.29"
>3.29
  (JDHEDDEN on 2007-11-07)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.28"
>3.28
  (JDHEDDEN on 2007-11-07)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.27"
>3.27
  (JDHEDDEN on 2007-11-03)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.26"
>3.26
  (JDHEDDEN on 2007-09-18)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.25"
>3.25
  (JDHEDDEN on 2007-09-11)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.24"
>3.24
  (JDHEDDEN on 2007-09-11)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.23"
>3.23
  (JDHEDDEN on 2007-09-11)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.22"
>3.22
  (JDHEDDEN on 2007-09-07)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.21"
>3.21
  (JDHEDDEN on 2007-08-17)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.19"
>3.19
  (JDHEDDEN on 2007-06-26)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.18"
>3.18
  (JDHEDDEN on 2007-06-08)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.17"
>3.17
  (JDHEDDEN on 2007-05-11)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.16"
>3.16
  (JDHEDDEN on 2007-05-10)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.15"
>3.15
  (JDHEDDEN on 2007-05-10)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.14"
>3.14
  (JDHEDDEN on 2007-03-26)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.13"
>3.13
  (JDHEDDEN on 2007-03-19)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.12"
>3.12
  (JDHEDDEN on 2007-03-15)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.11"
>3.11
  (JDHEDDEN on 2007-02-19)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.09"
>3.09
  (JDHEDDEN on 2007-02-17)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.08"
>3.08
  (JDHEDDEN on 2006-12-27)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.07"
>3.07
  (JDHEDDEN on 2006-12-20)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.06"
>3.06
  (JDHEDDEN on 2006-12-11)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.05"
>3.05
  (JDHEDDEN on 2006-12-09)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.04"
>3.04
  (JDHEDDEN on 2006-12-08)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.03"
>3.03
  (JDHEDDEN on 2006-12-07)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-3.01"
>3.01
  (JDHEDDEN on 2006-12-05)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.25"
>2.25
  (JDHEDDEN on 2006-11-30)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.24"
>2.24
  (JDHEDDEN on 2006-11-27)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.23"
>2.23
  (JDHEDDEN on 2006-11-14)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.22"
>2.22
  (JDHEDDEN on 2006-11-14)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.21"
>2.21
  (JDHEDDEN on 2006-11-13)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.19"
>2.19
  (JDHEDDEN on 2006-11-02)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.18"
>2.18
  (JDHEDDEN on 2006-11-01)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.17"
>2.17
  (JDHEDDEN on 2006-10-31)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.16"
>2.16
  (JDHEDDEN on 2006-10-23)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.15"
>2.15
  (JDHEDDEN on 2006-10-20)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.14"
>2.14
  (JDHEDDEN on 2006-10-17)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.13"
>2.13
  (JDHEDDEN on 2006-10-17)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.12"
>2.12
  (JDHEDDEN on 2006-10-13)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.11"
>2.11
  (JDHEDDEN on 2006-10-13)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.09"
>2.09
  (JDHEDDEN on 2006-10-13)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.08"
>2.08
  (JDHEDDEN on 2006-10-11)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.07"
>2.07
  (JDHEDDEN on 2006-10-10)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.06"
>2.06
  (JDHEDDEN on 2006-10-09)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.05"
>2.05
  (JDHEDDEN on 2006-10-06)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.04"
>2.04
  (JDHEDDEN on 2006-10-03)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.03"
>2.03
  (JDHEDDEN on 2006-10-03)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.02"
>2.02
  (JDHEDDEN on 2006-09-23)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-2.01"
>2.01
  (JDHEDDEN on 2006-09-19)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.52"
>1.52
  (JDHEDDEN on 2006-09-01)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.51"
>1.51
  (JDHEDDEN on 2006-08-30)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.49"
>1.49
  (JDHEDDEN on 2006-08-08)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.48"
>1.48
  (JDHEDDEN on 2006-08-03)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.47"
>1.47
  (JDHEDDEN on 2006-08-01)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.46"
>1.46
  (JDHEDDEN on 2006-07-27)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.45"
>1.45
  (JDHEDDEN on 2006-06-27)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.44"
>1.44
  (JDHEDDEN on 2006-06-23)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.43"
>1.43
  (JDHEDDEN on 2006-06-23)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.42"
>1.42
  (JDHEDDEN on 2006-05-04)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.41"
>1.41
  (JDHEDDEN on 2006-04-27)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.39"
>1.39
  (JDHEDDEN on 2006-04-27)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.38"
>1.38
  (JDHEDDEN on 2006-03-06)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.37"
>1.37
  (JDHEDDEN on 2006-02-15)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.36"
>1.36
  (JDHEDDEN on 2006-02-08)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.35"
>1.35
  (JDHEDDEN on 2006-02-03)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.34"
>1.34
  (JDHEDDEN on 2006-02-01)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.33"
>1.33
  (JDHEDDEN on 2006-01-19)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.32"
>1.32
  (JDHEDDEN on 2006-01-18)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.31"
>1.31
  (JDHEDDEN on 2006-01-14)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.29"
>1.29
  (JDHEDDEN on 2006-01-09)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.28"
>1.28
  (JDHEDDEN on 2006-01-06)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.27"
>1.27
  (JDHEDDEN on 2005-12-28)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.26"
>1.26
  (JDHEDDEN on 2005-12-21)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.25"
>1.25
  (JDHEDDEN on 2005-12-21)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.24"
>1.24
  (JDHEDDEN on 2005-12-16)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.23"
>1.23
  (JDHEDDEN on 2005-12-12)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.22"
>1.22
  (JDHEDDEN on 2005-12-09)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.21"
>1.21
  (JDHEDDEN on 2005-12-08)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.19"
>1.19
  (JDHEDDEN on 2005-12-08)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.18"
>1.18
  (JDHEDDEN on 2005-12-07)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.17"
>1.17
  (JDHEDDEN on 2005-12-02)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.16"
>1.16
  (JDHEDDEN on 2005-12-01)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.15"
>1.15
  (JDHEDDEN on 2005-11-29)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.14"
>1.14
  (JDHEDDEN on 2005-11-23)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.13"
>1.13
  (JDHEDDEN on 2005-11-21)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.12"
>1.12
  (JDHEDDEN on 2005-11-21)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.11"
>1.11
  (JDHEDDEN on 2005-11-18)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.1"
>1.1
  (JDHEDDEN on 2005-11-17)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.05.00"
>1.05.00
  (JDHEDDEN on 2005-11-17)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.04.00"
>1.04.00
  (JDHEDDEN on 2005-11-16)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.03.00"
>1.03.00
  (JDHEDDEN on 2005-11-15)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.02.00"
>1.02.00
  (JDHEDDEN on 2005-11-15)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.01.00"
>1.01.00
  (JDHEDDEN on 2005-11-14)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-1.00.00"
>1.00.00
  (JDHEDDEN on 2005-11-11)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-0.07.00"
>0.07.00
  (JDHEDDEN on 2005-11-10)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-0.06.00"
>0.06.00
  (JDHEDDEN on 2005-11-03)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-0.05.00"
>0.05.00
  (JDHEDDEN on 2005-11-03)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-0.04.00"
>0.04.00
  (JDHEDDEN on 2005-11-02)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-0.03.00"
>0.03.00
  (JDHEDDEN on 2005-11-01)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-0.02.00"
>0.02.00
  (JDHEDDEN on 2005-10-31)</option>
<option
  
  value="JDHEDDEN/Object-InsideOut-0.01.00"
>0.01.00
  (JDHEDDEN on 2005-10-31)</option>
</optgroup>
</select>
    <a data-keyboard-shortcut="g d" class="release-name" href="https://metacpan.org/dist/Object-InsideOut">Object-InsideOut-4.05</a>
  </div>
<span class="river-gauge-gauge">
  <svg width="24px"
       height="15px"
       version="1.1"
       xmlns="http://www.w3.org/2000/svg"
       xmlns:xlink="http://www.w3.org/1999/xlink">

    <g>
      <title>        River stage two &#10;
          • 23 direct dependents &#10;          • 38 total dependents
      </title>

      <rect x="0"  y="0" width="4" height="15" fill="#7ea3f2" />
      <rect x="5"  y="0" width="4" height="15" fill="#7ea3f2" />
      <rect x="10"  y="0" width="4" height="15" fill="#e4e2e2" />
      <rect x="15"  y="0" width="4" height="15" fill="#e4e2e2" />
      <rect x="20"  y="0" width="4" height="15" fill="#e4e2e2" />
    </g>
  </svg>

</span>
<div id="Object-InsideOut-fav" class="logged_in">
<form action="https://metacpan.org/account/favorite/add" style="display: inline" onsubmit="return favDistribution(this)">
    <input type="hidden" name="remove" value="0">
    <input type="hidden" name="release" value="Object-InsideOut-4.05">
    <input type="hidden" name="author" value="JDHEDDEN">
    <input type="hidden" name="distribution" value="Object-InsideOut">
    <button type="submit" class="favorite highlight"><span>5</span> ++</button>
</form>
</div>
<div class="logged_out">
<a href="./Object::InsideOut.html" onclick="alert('Please sign in to add favorites'); return false" class="favorite highlight">
<span>5</span> ++</a>
</div>
   / <span>Object::InsideOut</span>
</div>
          </div>
          <main class="content">


<nav class="toc">
  <div class="toc-header"><strong>Contents</strong></div>
<ul>
  <li><a href="./Object::InsideOut.html#NAME">NAME</a></li>
  <li><a href="./Object::InsideOut.html#VERSION">VERSION</a></li>
  <li><a href="./Object::InsideOut.html#SYNOPSIS">SYNOPSIS</a></li>
  <li><a href="./Object::InsideOut.html#DESCRIPTION">DESCRIPTION</a></li>
  <li><a href="./Object::InsideOut.html#CLASSES">CLASSES</a></li>
  <li><a href="./Object::InsideOut.html#OBJECTS">OBJECTS</a>
    <ul>
      <li><a href="./Object::InsideOut.html#Object-Creation">Object Creation</a></li>
      <li><a href="./Object::InsideOut.html#Object-IDs">Object IDs</a></li>
    </ul>
  </li>
  <li><a href="./Object::InsideOut.html#ATTRIBUTES">ATTRIBUTES</a></li>
  <li><a href="./Object::InsideOut.html#FIELDS">FIELDS</a>
    <ul>
      <li><a href="./Object::InsideOut.html#Field-Declarations">Field Declarations</a></li>
      <li><a href="./Object::InsideOut.html#Getting-Data">Getting Data</a></li>
      <li><a href="./Object::InsideOut.html#Setting-Data">Setting Data</a></li>
    </ul>
  </li>
  <li><a href="./Object::InsideOut.html#OBJECT-INITIALIZATION">OBJECT INITIALIZATION</a>
    <ul>
      <li><a href="./Object::InsideOut.html#Field-Specific-Parameters">Field-Specific Parameters</a></li>
      <li><a href="./Object::InsideOut.html#Object-Initialization-Subroutines">Object Initialization Subroutines</a></li>
      <li><a href="./Object::InsideOut.html#Mandatory-Parameters">Mandatory Parameters</a></li>
      <li><a href="./Object::InsideOut.html#Default-Values">Default Values</a>
        <ul>
          <li><a href="./Object::InsideOut.html#Generated-Default-Values">Generated Default Values</a></li>
          <li><a href="./Object::InsideOut.html#Sequential-defaults">Sequential defaults</a></li>
        </ul>
      </li>
      <li><a href="./Object::InsideOut.html#Parameter-Name-Matching">Parameter Name Matching</a></li>
      <li><a href="./Object::InsideOut.html#Object-Pre-initialization">Object Pre-initialization</a></li>
      <li><a href="./Object::InsideOut.html#Initialization-Sequence">Initialization Sequence</a></li>
      <li><a href="./Object::InsideOut.html#Unhandled-Parameters">Unhandled Parameters</a></li>
      <li><a href="./Object::InsideOut.html#Modifying-:InitArgs">Modifying :InitArgs</a></li>
    </ul>
  </li>
  <li><a href="./Object::InsideOut.html#ACCESSOR-GENERATION">ACCESSOR GENERATION</a>
    <ul>
      <li><a href="./Object::InsideOut.html#Basic-Accessors">Basic Accessors</a></li>
      <li><a href="./Object::InsideOut.html#Set-Accessor-Return-Value">Set Accessor Return Value</a></li>
      <li><a href="./Object::InsideOut.html#Method-Chaining">Method Chaining</a></li>
      <li><a href="./Object::InsideOut.html#:lvalue-Accessors">:lvalue Accessors</a></li>
    </ul>
  </li>
  <li><a href="./Object::InsideOut.html#ALL-IN-ONE">ALL-IN-ONE</a></li>
  <li><a href="./Object::InsideOut.html#READONLY-FIELDS">READONLY FIELDS</a></li>
  <li><a href="./Object::InsideOut.html#DELEGATORS">DELEGATORS</a></li>
  <li><a href="./Object::InsideOut.html#PERMISSIONS">PERMISSIONS</a>
    <ul>
      <li><a href="./Object::InsideOut.html#Restricted-and-Private-Accessors">Restricted and Private Accessors</a></li>
      <li><a href="./Object::InsideOut.html#Restricted-and-Private-Methods">Restricted and Private Methods</a></li>
      <li><a href="./Object::InsideOut.html#Exemptions">Exemptions</a></li>
      <li><a href="./Object::InsideOut.html#Hidden-Methods">Hidden Methods</a></li>
      <li><a href="./Object::InsideOut.html#Restricted-and-Private-Classes">Restricted and Private Classes</a></li>
    </ul>
  </li>
  <li><a href="./Object::InsideOut.html#TYPE-CHECKING">TYPE CHECKING</a>
    <ul>
      <li><a href="./Object::InsideOut.html#Field-Type-Checking">Field Type Checking</a></li>
      <li><a href="./Object::InsideOut.html#Type-Checking-on-:Init-Parameters">Type Checking on :Init Parameters</a></li>
    </ul>
  </li>
  <li><a href="./Object::InsideOut.html#CUMULATIVE-METHODS">CUMULATIVE METHODS</a></li>
  <li><a href="./Object::InsideOut.html#CHAINED-METHODS">CHAINED METHODS</a></li>
  <li><a href="./Object::InsideOut.html#ARGUMENT-MERGING">ARGUMENT MERGING</a></li>
  <li><a href="./Object::InsideOut.html#ARGUMENT-VALIDATION">ARGUMENT VALIDATION</a></li>
  <li><a href="./Object::InsideOut.html#AUTOMETHODS">AUTOMETHODS</a></li>
  <li><a href="./Object::InsideOut.html#OBJECT-SERIALIZATION">OBJECT SERIALIZATION</a>
    <ul>
      <li><a href="./Object::InsideOut.html#Basic-Serialization">Basic Serialization</a></li>
      <li><a href="./Object::InsideOut.html#Storable">Storable</a></li>
    </ul>
  </li>
  <li><a href="./Object::InsideOut.html#OBJECT-COERCION">OBJECT COERCION</a></li>
  <li><a href="./Object::InsideOut.html#CLONING">CLONING</a>
    <ul>
      <li><a href="./Object::InsideOut.html#Object-Cloning">Object Cloning</a></li>
      <li><a href="./Object::InsideOut.html#Field-Cloning">Field Cloning</a></li>
    </ul>
  </li>
  <li><a href="./Object::InsideOut.html#WEAK-FIELDS">WEAK FIELDS</a></li>
  <li><a href="./Object::InsideOut.html#DYNAMIC-FIELD-CREATION">DYNAMIC FIELD CREATION</a></li>
  <li><a href="./Object::InsideOut.html#RUNTIME-INHERITANCE">RUNTIME INHERITANCE</a></li>
  <li><a href="./Object::InsideOut.html#PREPROCESSING">PREPROCESSING</a>
    <ul>
      <li><a href="./Object::InsideOut.html#Parameter-Preprocessing">Parameter Preprocessing</a></li>
      <li><a href="./Object::InsideOut.html#Set-Accessor-Preprocessing">Set Accessor Preprocessing</a></li>
    </ul>
  </li>
  <li><a href="./Object::InsideOut.html#SPECIAL-PROCESSING">SPECIAL PROCESSING</a>
    <ul>
      <li><a href="./Object::InsideOut.html#Object-ID">Object ID</a></li>
      <li><a href="./Object::InsideOut.html#Object-Replication">Object Replication</a></li>
      <li><a href="./Object::InsideOut.html#Object-Destruction">Object Destruction</a></li>
    </ul>
  </li>
  <li><a href="./Object::InsideOut.html#FOREIGN-CLASS-INHERITANCE">FOREIGN CLASS INHERITANCE</a>
    <ul>
      <li><a href="./Object::InsideOut.html#use-base-and-Fully-qualified-Method-Names">use base and Fully-qualified Method Names</a></li>
    </ul>
  </li>
  <li><a href="./Object::InsideOut.html#INTROSPECTION">INTROSPECTION</a></li>
  <li><a href="./Object::InsideOut.html#THREAD-SUPPORT">THREAD SUPPORT</a></li>
  <li><a href="./Object::InsideOut.html#HASH-ONLY-CLASSES">HASH ONLY CLASSES</a></li>
  <li><a href="./Object::InsideOut.html#SECURITY">SECURITY</a></li>
  <li><a href="./Object::InsideOut.html#ATTRIBUTE-HANDLERS">ATTRIBUTE HANDLERS</a></li>
  <li><a href="./Object::InsideOut.html#SPECIAL-USAGE">SPECIAL USAGE</a>
    <ul>
      <li><a href="./Object::InsideOut.html#Usage-With-Exporter">Usage With Exporter</a></li>
      <li><a href="./Object::InsideOut.html#Usage-With-require-and-mod_perl">Usage With require and mod_perl</a></li>
      <li><a href="./Object::InsideOut.html#Singleton-Classes">Singleton Classes</a></li>
    </ul>
  </li>
  <li><a href="./Object::InsideOut.html#DIAGNOSTICS">DIAGNOSTICS</a></li>
  <li><a href="./Object::InsideOut.html#BUGS-AND-LIMITATIONS">BUGS AND LIMITATIONS</a></li>
  <li><a href="./Object::InsideOut.html#REQUIREMENTS">REQUIREMENTS</a></li>
  <li><a href="./Object::InsideOut.html#SEE-ALSO">SEE ALSO</a></li>
  <li><a href="./Object::InsideOut.html#ACKNOWLEDGEMENTS">ACKNOWLEDGEMENTS</a></li>
  <li><a href="./Object::InsideOut.html#AUTHOR">AUTHOR</a></li>
  <li><a href="./Object::InsideOut.html#COPYRIGHT-AND-LICENSE">COPYRIGHT AND LICENSE</a></li>
  <li><a href="./Object::InsideOut.html#TRANSLATIONS">TRANSLATIONS</a></li>
</ul></nav>
<div class="pod anchors">
<h1 id="NAME">NAME</h1>

<p>Object::InsideOut - Comprehensive inside-out object support module</p>

<h1 id="VERSION">VERSION</h1>

<p>This document describes Object::InsideOut version 4.05</p>

<h1 id="SYNOPSIS">SYNOPSIS</h1>

<pre><code> package My::Class; {
     use Object::InsideOut;

     # Numeric field
     #   With combined get+set accessor
     my @data
            :Field
            :Type(numeric)
            :Accessor(data);

     # Takes &#39;INPUT&#39; (or &#39;input&#39;, etc.) as a mandatory parameter to -&gt;new()
     my %init_args :InitArgs = (
         &#39;INPUT&#39; =&gt; {
             &#39;Regex&#39;     =&gt; qr/^input$/i,
             &#39;Mandatory&#39; =&gt; 1,
             &#39;Type&#39;      =&gt; &#39;numeric&#39;,
         },
     );

     # Handle class-specific args as part of -&gt;new()
     sub init :Init
     {
         my ($self, $args) = @_;

         # Put &#39;input&#39; parameter into &#39;data&#39; field
         $self-&gt;set(\@data, $args-&gt;{&#39;INPUT&#39;});
     }
 }

 package My::Class::Sub; {
     use Object::InsideOut qw(My::Class);

     # List field
     #   With standard &#39;get_X&#39; and &#39;set_X&#39; accessors
     #   Takes &#39;INFO&#39; as an optional list parameter to -&gt;new()
     #     Value automatically added to @info array
     #     Defaults to [ &#39;empty&#39; ]
     my @info
            :Field
            :Type(list)
            :Standard(info)
            :Arg(&#39;Name&#39; =&gt; &#39;INFO&#39;, &#39;Default&#39; =&gt; &#39;empty&#39;);
 }

 package Foo; {
     use Object::InsideOut;

     # Field containing My::Class objects
     #   With combined accessor
     #   Plus automatic parameter processing on object creation
     my @foo
            :Field
            :Type(My::Class)
            :All(foo);
 }

 package main;

 my $obj = My::Class::Sub-&gt;new(&#39;Input&#39; =&gt; 69);
 my $info = $obj-&gt;get_info();               # [ &#39;empty&#39; ]
 my $data = $obj-&gt;data();                   # 69
 $obj-&gt;data(42);
 $data = $obj-&gt;data();                      # 42

 $obj = My::Class::Sub-&gt;new(&#39;INFO&#39; =&gt; &#39;help&#39;, &#39;INPUT&#39; =&gt; 86);
 $data = $obj-&gt;data();                      # 86
 $info = $obj-&gt;get_info();                  # [ &#39;help&#39; ]
 $obj-&gt;set_info(qw(foo bar baz));
 $info = $obj-&gt;get_info();                  # [ &#39;foo&#39;, &#39;bar&#39;, &#39;baz&#39; ]

 my $foo_obj = Foo-&gt;new(&#39;foo&#39; =&gt; $obj);
 $foo_obj-&gt;foo()-&gt;data();                   # 86</code></pre>

<h1 id="DESCRIPTION">DESCRIPTION</h1>

<p>This module provides comprehensive support for implementing classes using the inside-out object model.</p>

<p>Object::InsideOut implements inside-out objects as anonymous scalar references that are blessed into a class with the scalar containing the ID for the object (usually a sequence number). For Perl 5.8.3 and later, the scalar reference is set as <b>read-only</b> to prevent <i>accidental</i> modifications to the ID. Object data (i.e., fields) are stored within the class&#39;s package in either arrays indexed by the object&#39;s ID, or hashes keyed to the object&#39;s ID.</p>

<p>The virtues of the inside-out object model over the <i>blessed hash</i> object model have been extolled in detail elsewhere. See the informational links under <a href="./Object::InsideOut.html#SEE-ALSO">&quot;SEE ALSO&quot;</a>. Briefly, inside-out objects offer the following advantages over <i>blessed hash</i> objects:</p>

<ul>

<li><p>Encapsulation</p>

<p>Object data is enclosed within the class&#39;s code and is accessible only through the class-defined interface.</p>

</li>
<li><p>Field Name Collision Avoidance</p>

<p>Inheritance using <i>blessed hash</i> classes can lead to conflicts if any classes use the same name for a field (i.e., hash key). Inside-out objects are immune to this problem because object data is stored inside each class&#39;s package, and not in the object itself.</p>

</li>
<li><p>Compile-time Name Checking</p>

<p>A common error with <i>blessed hash</i> classes is the misspelling of field names:</p>

<pre><code> $obj-&gt;{&#39;coment&#39;} = &#39;Say what?&#39;;   # Should be &#39;comment&#39; not &#39;coment&#39;</code></pre>

<p>As there is no compile-time checking on hash keys, such errors do not usually manifest themselves until runtime.</p>

<p>With inside-out objects, <i>text</i> hash keys are not used for accessing field data. Field names and the data index (i.e., $$self) are checked by the Perl compiler such that any typos are easily caught using <span style="white-space: nowrap;"><code>perl -c</code></span>.</p>

<pre><code> $coment[$$self] = $value;    # Causes a compile-time error
    # or with hash-based fields
 $comment{$$self} = $value;   # Also causes a compile-time error</code></pre>

</li>
</ul>

<p>Object::InsideOut offers all the capabilities of other inside-out object modules with the following additional key advantages:</p>

<ul>

<li><p>Speed</p>

<p>When using arrays to store object data, Object::InsideOut objects are as much as 40% faster than <i>blessed hash</i> objects for fetching and setting data, and even with hashes they are still several percent faster than <i>blessed hash</i> objects.</p>

</li>
<li><p>Threads</p>

<p>Object::InsideOut is thread safe, and thoroughly supports sharing objects between threads using <a href="https://metacpan.org/pod/threads::shared">threads::shared</a>.</p>

</li>
<li><p>Flexibility</p>

<p>Allows control over object ID specification, accessor naming, parameter name matching, and much more.</p>

</li>
<li><p>Runtime Support</p>

<p>Supports classes that may be loaded at runtime (i.e., using <span style="white-space: nowrap;"><code>eval { require ...; };</code></span>). This makes it usable from within <a href="https://metacpan.org/pod/mod_perl">mod_perl</a>, as well. Also supports additions to class hierarchies, and dynamic creation of object fields during runtime.</p>

</li>
<li><p>Exception Objects</p>

<p>Object::InsideOut uses <a href="https://metacpan.org/pod/Exception::Class">Exception::Class</a> for handling errors in an OO-compatible manner.</p>

</li>
<li><p>Object Serialization</p>

<p>Object::InsideOut has built-in support for object dumping and reloading that can be accomplished in either an automated fashion or through the use of class-supplied subroutines. Serialization using <a href="https://metacpan.org/pod/Storable">Storable</a> is also supported.</p>

</li>
<li><p>Foreign Class Inheritance</p>

<p>Object::InsideOut allows classes to inherit from foreign (i.e., non-Object::InsideOut) classes, thus allowing you to sub-class other Perl class, and access their methods from your own objects.</p>

</li>
<li><p>Introspection</p>

<p>Obtain constructor parameters and method metadata for Object::InsideOut classes.</p>

</li>
</ul>

<h1 id="CLASSES">CLASSES</h1>

<p>To use this module, each of your classes will start with <span style="white-space: nowrap;"><code>use Object::InsideOut;</code></span>:</p>

<pre><code> package My::Class; {
     use Object::InsideOut;
     ...
 }</code></pre>

<p>Sub-classes (child classes) inherit from base classes (parent classes) by telling Object::InsideOut what the parent class is:</p>

<pre><code> package My::Sub; {
     use Object::InsideOut qw(My::Parent);
     ...
 }</code></pre>

<p>Multiple inheritance is also supported:</p>

<pre><code> package My::Project; {
     use Object::InsideOut qw(My::Class Another::Class);
     ...
 }</code></pre>

<p>Object::InsideOut acts as a replacement for the <code>base</code> pragma: It loads the parent module(s), calls their <code>-&gt;import()</code> methods, and sets up the sub-class&#39;s @ISA array. Therefore, you should not <span style="white-space: nowrap;"><code>use base ...</code></span> yourself, nor try to set up <code>@ISA</code> arrays. Further, you should not use a class&#39;s <code>@ISA</code> array to determine a class&#39;s hierarchy: See <a href="./Object::InsideOut.html#INTROSPECTION">&quot;INTROSPECTION&quot;</a> for details on how to do this.</p>

<p>If a parent class takes parameters (e.g., symbols to be exported via <a href="./Object::InsideOut.html#Usage-With-Exporter">Exporter</a>), enclose them in an array ref (mandatory) following the name of the parent class:</p>

<pre><code> package My::Project; {
     use Object::InsideOut &#39;My::Class&#39;      =&gt; [ &#39;param1&#39;, &#39;param2&#39; ],
                           &#39;Another::Class&#39; =&gt; [ &#39;param&#39; ];
     ...
 }</code></pre>

<h1 id="OBJECTS">OBJECTS</h1>

<h2 id="Object-Creation"><a id="Object"></a>Object Creation</h2>

<p>Objects are created using the <code>-&gt;new()</code> method which is exported by Object::InsideOut to each class, and is invoked in the following manner:</p>

<pre><code> my $obj = My::Class-&gt;new();</code></pre>

<p>Object::InsideOut then handles all the messy details of initializing the object in each of the classes in the invoking class&#39;s hierarchy. As such, classes do not (normally) implement their own <code>-&gt;new()</code> method.</p>

<p>Usually, object fields are initially populated with data as part of the object creation process by passing parameters to the <code>-&gt;new()</code> method. Parameters are passed in as combinations of <span style="white-space: nowrap;"><code>key =&gt; value</code></span> pairs and/or hash refs:</p>

<pre><code> my $obj = My::Class-&gt;new(&#39;param1&#39; =&gt; &#39;value1&#39;);
     # or
 my $obj = My::Class-&gt;new({&#39;param1&#39; =&gt; &#39;value1&#39;});
     # or even
 my $obj = My::Class-&gt;new(
     &#39;param_X&#39; =&gt; &#39;value_X&#39;,
     &#39;param_Y&#39; =&gt; &#39;value_Y&#39;,
     {
         &#39;param_A&#39; =&gt; &#39;value_A&#39;,
         &#39;param_B&#39; =&gt; &#39;value_B&#39;,
     },
     {
         &#39;param_Q&#39; =&gt; &#39;value_Q&#39;,
     },
 );</code></pre>

<p>Additionally, parameters can be segregated in hash refs for specific classes:</p>

<pre><code> my $obj = My::Class-&gt;new(
     &#39;foo&#39; =&gt; &#39;bar&#39;,
     &#39;My::Class&#39;      =&gt; { &#39;param&#39; =&gt; &#39;value&#39; },
     &#39;Parent::Class&#39;  =&gt; { &#39;data&#39;  =&gt; &#39;info&#39;  },
 );</code></pre>

<p>The initialization methods for both classes in the above will get <span style="white-space: nowrap;"><code>&#39;foo&#39; =&gt; &#39;bar&#39;</code></span>, <code>My::Class</code> will also get <span style="white-space: nowrap;"><code>&#39;param&#39; =&gt; &#39;value&#39;</code></span>, and <code>Parent::Class</code> will also get <span style="white-space: nowrap;"><code>&#39;data&#39; =&gt; &#39;info&#39;</code></span>. In this scheme, class-specific parameters will override general parameters specified at a higher level:</p>

<pre><code> my $obj = My::Class-&gt;new(
     &#39;default&#39; =&gt; &#39;bar&#39;,
     &#39;Parent::Class&#39;  =&gt; { &#39;default&#39; =&gt; &#39;baz&#39; },
 );</code></pre>

<p><code>My::Class</code> will get <span style="white-space: nowrap;"><code>&#39;default&#39; =&gt; &#39;bar&#39;</code></span>, and <code>Parent::Class</code> will get <span style="white-space: nowrap;"><code>&#39;default&#39; =&gt; &#39;baz&#39;</code></span>.</p>

<p>Calling <code>-&gt;new()</code> on an object works, too, and operates the same as calling <code>-&gt;new()</code> for the class of the object (i.e., <code>$obj-&gt;new()</code> is the same as <code>ref($obj)-&gt;new()</code>).</p>

<p>How the parameters passed to the <code>-&gt;new()</code> method are used to initialize the object is discussed later under <a href="./Object::InsideOut.html#OBJECT-INITIALIZATION">&quot;OBJECT INITIALIZATION&quot;</a>.</p>

<p>NOTE: You cannot create objects from Object::InsideOut itself:</p>

<pre><code> # This is an error
 # my $obj = Object::InsideOut-&gt;new();</code></pre>

<p>In this way, Object::InsideOut is not an object class, but functions more like a pragma.</p>

<h2 id="Object-IDs"><a id="Object1"></a>Object IDs</h2>

<p>As stated earlier, this module implements inside-out objects as anonymous, read-only scalar references that are blessed into a class with the scalar containing the ID for the object.</p>

<p>Within methods, the object is passed in as the first argument:</p>

<pre><code> sub my_method
 {
     my $self = shift;
     ...
 }</code></pre>

<p>The object&#39;s ID is then obtained by dereferencing the object: <code>$$self</code>. Normally, this is only needed when accessing the object&#39;s field data:</p>

<pre><code> my @my_field :Field;

 sub my_method
 {
     my $self = shift;
     ...
     my $data = $my_field[$$self];
     ...
 }</code></pre>

<p>At all other times, and especially in application code, the object should be treated as an <i>opaque</i> entity.</p>

<h1 id="ATTRIBUTES">ATTRIBUTES</h1>

<p>Much of the power of Object::InsideOut comes from the use of <i>attributes</i>: <i>Tags</i> on variables and subroutines that the <a href="https://metacpan.org/pod/attributes">attributes</a> module sends to Object::InsideOut at compile time. Object::InsideOut then makes use of the information in these tags to handle such operations as object construction, automatic accessor generation, and so on.</p>

<p>(Note: The use of attributes is not the same thing as <a href="https://metacpan.org/pod/Filter::Simple">source filtering</a>.)</p>

<p>An attribute consists of an identifier preceded by a colon, and optionally followed by a set of parameters in parentheses. For example, the attributes on the following array declare it as an object field, and specify the generation of an accessor method for that field:</p>

<pre><code> my @level :Field :Accessor(level);</code></pre>

<p>When multiple attributes are assigned to a single entity, they may all appear on the same line (as shown above), or on separate lines:</p>

<pre><code> my @level
     :Field
     :Accessor(level);</code></pre>

<p>However, due to limitations in the Perl parser, the entirety of any one attribute must be on a single line:</p>

<pre><code> # This doesn&#39;t work
 # my @level
 #     :Field
 #     :Accessor(&#39;Name&#39;   =&gt; &#39;level&#39;,
 #               &#39;Return&#39; =&gt; &#39;Old&#39;);

 # Each attribute must be all on one line
 my @level
     :Field
     :Accessor(&#39;Name&#39; =&gt; &#39;level&#39;, &#39;Return&#39; =&gt; &#39;Old&#39;);</code></pre>

<p>For Object::InsideOut&#39;s purposes, the case of an attribute&#39;s name does not matter:</p>

<pre><code> my @data :Field;
    # or
 my @data :FIELD;</code></pre>

<p>However, by convention (as denoted in the <a href="https://metacpan.org/pod/attributes">attributes</a> module), an attribute&#39;s name should not be all lowercase.</p>

<h1 id="FIELDS">FIELDS</h1>

<h2 id="Field-Declarations"><a id="Field"></a>Field Declarations</h2>

<p>Object data fields consist of arrays within a class&#39;s package into which data are stored using the object&#39;s ID as the array index. An array is declared as being an object field by following its declaration with the <code>:Field</code> attribute:</p>

<pre><code> my @info :Field;</code></pre>

<p>Object data fields may also be hashes:</p>

<pre><code> my %data :Field;</code></pre>

<p>However, as array access is as much as 40% faster than hash access, you should stick to using arrays. See <a href="./Object::InsideOut.html#HASH-ONLY-CLASSES">&quot;HASH ONLY CLASSES&quot;</a> for more information on when hashes may be required.</p>

<h2 id="Getting-Data"><a id="Getting"></a>Getting Data</h2>

<p>In class code, data can be fetched directly from an object&#39;s field array (hash) using the object&#39;s ID:</p>

<pre><code> $data = $field[$$self];
     # or
 $data = $field{$$self};</code></pre>

<h2 id="Setting-Data"><a id="Setting"></a>Setting Data</h2>

<p>Analogous to the above, data can be put directly into an object&#39;s field array (hash) using the object&#39;s ID:</p>

<pre><code> $field[$$self] = $data;
     # or
 $field{$$self} = $data;</code></pre>

<p>However, in threaded applications that use data sharing (i.e., use <code>threads::shared</code>), the above will not work when the object is shared between threads and the data being stored is either an array, hash or scalar reference (this includes other objects). This is because the <code>$data</code> must first be converted into shared data before it can be put into the field.</p>

<p>Therefore, Object::InsideOut automatically exports a method called <code>-&gt;set()</code> to each class. This method should be used in class code to put data into object fields whenever there is the possibility that the class code may be used in an application that uses <a href="https://metacpan.org/pod/threads::shared">threads::shared</a> (i.e., to make your class code <b>thread-safe</b>). The <code>-&gt;set()</code> method handles all details of converting the data to a shared form, and storing it in the field.</p>

<p>The <code>-&gt;set()</code> method, requires two arguments: A reference to the object field array/hash, and the data (as a scalar) to be put in it:</p>

<pre><code> my @my_field :Field;

 sub store_data
 {
     my ($self, $data) = @_;
     ...
     $self-&gt;set(\@my_field, $data);
 }</code></pre>

<p>To be clear, the <code>-&gt;set()</code> method is used inside class code; not application code. Use it inside any object methods that set data in object field arrays/hashes.</p>

<p>In the event of a method naming conflict, the <code>-&gt;set()</code> method can be called using its fully-qualified name:</p>

<pre><code> $self-&gt;Object::InsideOut::set(\@field, $data);</code></pre>

<h1 id="OBJECT-INITIALIZATION"><a id="OBJECT"></a>OBJECT INITIALIZATION</h1>

<p>As stated in <a href="./Object::InsideOut.html#Object-Creation">&quot;Object Creation&quot;</a>, object fields are initially populated with data as part of the object creation process by passing <span style="white-space: nowrap;"><code>key =&gt; value</code></span> parameters to the <code>-&gt;new()</code> method. These parameters can be processed automatically into object fields, or can be passed to a class-specific object initialization subroutine.</p>

<h2 id="Field-Specific-Parameters"><a id="Field1"></a>Field-Specific Parameters</h2>

<p>When an object creation parameter corresponds directly to an object field, you can specify for Object::InsideOut to automatically place the parameter into the field by adding the <code>:Arg</code> attribute to the field declaration:</p>

<pre><code> my @foo :Field :Arg(foo);</code></pre>

<p>For the above, the following would result in <code>$val</code> being placed in <code>My::Class</code>&#39;s <code>@foo</code> field during object creation:</p>

<pre><code> my $obj = My::Class-&gt;new(&#39;foo&#39; =&gt; $val);</code></pre>

<h2 id="Object-Initialization-Subroutines"><a id="Object2"></a>Object Initialization Subroutines</h2>

<p>Many times, object initialization parameters do not correspond directly to object fields, or they may require special handling. For these, parameter processing is accomplished through a combination of an <code>:InitArgs</code> labeled hash, and an <code>:Init</code> labeled subroutine.</p>

<p>The <code>:InitArgs</code> labeled hash specifies the parameters to be extracted from the argument list supplied to the <code>-&gt;new()</code> method. Those parameters (and only those parameters) which match the keys in the <code>:InitArgs</code> hash are then packaged together into a single hash ref. The newly created object and this parameter hash ref are then sent to the <code>:Init</code> subroutine for processing.</p>

<p>Here is an example of a class with an <i>automatically handled</i> field and an <i>:Init handled</i> field:</p>

<pre><code> package My::Class; {
     use Object::InsideOut;

     # Automatically handled field
     my @my_data  :Field  :Acc(data)  :Arg(MY_DATA);

     # &#39;:Init&#39; handled field
     my @my_field :Field;

     my %init_args :InitArgs = (
         &#39;MY_PARAM&#39; =&gt; &#39;&#39;,
     );

     sub _init :Init
     {
         my ($self, $args) = @_;

         if (exists($args-&gt;{&#39;MY_PARAM&#39;})) {
             $self-&gt;set(\@my_field, $args-&gt;{&#39;MY_PARAM&#39;});
         }
     }

     ...
 }</code></pre>

<p>An object for this class would be created as follows:</p>

<pre><code> my $obj = My::Class-&gt;new(&#39;MY_DATA&#39;  =&gt; $dat,
                          &#39;MY_PARAM&#39; =&gt; $parm);</code></pre>

<p>This results in, first of all, <code>$dat</code> being placed in the object&#39;s <code>@my_data</code> field because the <code>MY_DATA</code> key is specified in the <code>:Arg</code> attribute for that field.</p>

<p>Then, <code>_init</code> is invoked with arguments consisting of the object (i.e., <code>$self</code>) and a hash ref consisting only of <span style="white-space: nowrap;"><code>{ &#39;MY_PARAM&#39; =&gt; $param }</code></span> because the key <code>MY_PARAM</code> is specified in the <code>:InitArgs</code> hash. <code>_init</code> checks that the parameter <code>MY_PARAM</code> exists in the hash ref, and then (since it does exist) adds <code>$parm</code> to the object&#39;s <code>@my_field</code> field.</p>

<dl>

<dt id="Setting-Data1"><a id="Setting1"></a>Setting Data</dt>
<dd>

<p>Data processed by the <code>:Init</code> subroutine may be placed directly into the class&#39;s field arrays (hashes) using the object&#39;s ID (i.e., <code>$$self</code>):</p>

<pre><code> $my_field[$$self] = $args-&gt;{&#39;MY_PARAM&#39;};</code></pre>

<p>However, as shown in the example above, it is strongly recommended that you use the <a href="./Object::InsideOut.html#Setting-Data">-&gt;set()</a> method:</p>

<pre><code> $self-&gt;set(\@my_field, $args-&gt;{&#39;MY_PARAM&#39;});</code></pre>

<p>which handles converting the data to a shared format when needed for applications using <a href="https://metacpan.org/pod/threads::shared">threads::shared</a>.</p>

</dd>
<dt id="All-Parameters"><a id="All"></a>All Parameters</dt>
<dd>

<p>The <code>:InitArgs</code> hash and the <code>:Arg</code> attribute on fields act as filters that constrain which initialization parameters are and are not sent to the <code>:Init</code> subroutine. If, however, a class does not have an <code>:InitArgs</code> hash <b>and</b> does not use the <code>:Arg</code> attribute on any of its fields, then its <code>:Init</code> subroutine (if it exists, of course) will get all the initialization parameters supplied to the <code>-&gt;new()</code> method.</p>

</dd>
</dl>

<h2 id="Mandatory-Parameters"><a id="Mandatory"></a>Mandatory Parameters</h2>

<p>Field-specific parameters may be declared mandatory as follows:</p>

<pre><code> my @data :Field
          :Arg(&#39;Name&#39; =&gt; &#39;data&#39;, &#39;Mandatory&#39; =&gt; 1);</code></pre>

<p>If a mandatory parameter is missing from the argument list to <code>-&gt;new()</code>, an error is generated.</p>

<p>For <code>:Init</code> handled parameters, use:</p>

<pre><code> my %init_args :InitArgs = (
     &#39;data&#39; =&gt; {
         &#39;Mandatory&#39; =&gt; 1,
     },
 );</code></pre>

<p><code>Mandatory</code> may be abbreviated to <code>Mand</code>, and <code>Required</code> or <code>Req</code> are synonymous.</p>

<h2 id="Default-Values"><a id="Default"></a>Default Values</h2>

<p>For optional parameters, defaults can be specified for field-specific parameters using either of these syntaxes:</p>

<pre><code> my @data :Field
          :Arg(&#39;Name&#39; =&gt; &#39;data&#39;, &#39;Default&#39; =&gt; &#39;foo&#39;);

 my @info :Field  :Arg(info)  :Default(&#39;bar&#39;);</code></pre>

<p>If an optional parameter with a specified default is missing from the argument list to <code>-&gt;new()</code>, then the default is assigned to the field when the object is created (before the <code>:Init</code> subroutine, if any, is called).</p>

<p>The format for <code>:Init</code> handled parameters is:</p>

<pre><code> my %init_args :InitArgs = (
     &#39;data&#39; =&gt; {
         &#39;Default&#39; =&gt; &#39;foo&#39;,
     },
 );</code></pre>

<p>In this case, if the parameter is missing from the argument list to <code>-&gt;new()</code>, then the parameter key is paired with the default value and added to the <code>:Init</code> argument hash ref (e.g., <span style="white-space: nowrap;"><code>{ &#39;data&#39; =&gt; &#39;foo&#39; }</code></span>).</p>

<p>Fields can also be assigned a default value even if not associated with an initialization parameter:</p>

<pre><code> my @hash  :Field  :Default({});
 my @tuple :Field  :Default([1, &#39;bar&#39;]);</code></pre>

<p>Note that when using <code>:Default</code>, the value must be properly structured Perl code (e.g., strings must be quoted as illustrated above).</p>

<p><code>Default</code> and <code>:Default</code> may be abbreviated to <code>Def</code> and <code>:Def</code> respectively.</p>

<h3 id="Generated-Default-Values"><a id="Generated"></a>Generated Default Values</h3>

<p>It is also possible to <i>generate</i> default values on a per object basis by using code in the <code>:Default</code> directive.</p>

<pre><code> my @IQ :Field  :Default(50 + rand 100);
 my @ID :Field  :Default(our $next; ++$next);</code></pre>

<p>The above, for example, will initialize the <code>IQ</code> attribute of each new object to a different random number, while its <code>ID</code> attribute will be initialized with a sequential integer.</p>

<p>The code in a <code>:Default</code> specifier can also refer to the object being initialized, either as <code>$_[0]</code> or as <code>$self</code>. For example:</p>

<pre><code> my @unique_ID :Field  :Default($self-&gt;gen_unique_ID);</code></pre>

<p>Any code specified as a default will <i>not</i> have access to the surrounding lexical scope. For example, this will not work:</p>

<pre><code> my $MAX = 100;
 my $MIN = 0;

 my @bar :Field
         :Default($MIN + rand($MAX-$MIX));     # Error</code></pre>

<p>For anything lexical or complex, you should factor the initializer out into a utility subroutine:</p>

<pre><code> sub _rand_max :Restricted
 {
     $MIN + rand($MAX-$MIX)
 }

 my @bar :Field
         :Default(_rand_max);</code></pre>

<p>When specifying a generated default using the <code>Default</code> tag inside an <code>:Arg</code> directive, you will need to wrap the code in a <code>sub { }</code>, and <code>$_[0]</code> (but not <code>$self</code>) can be used to access the object being initialized:</p>

<pre><code> my @baz :Field
         :Arg(Name =&gt; &#39;baz&#39;, Default =&gt; sub { $_[0]-&gt;biz });</code></pre>

<p>System functions need to similarly be wrapped in <code>sub { }</code>:</p>

<pre><code> my @rand :Field
          :Type(numeric)
          :Arg(Name =&gt; &#39;Rand&#39;, Default =&gt; sub { rand });</code></pre>

<p>Subroutines can be accessed using a code reference:</p>

<pre><code> my @data :Field
          :Arg(Name =&gt; &#39;Data&#39;, Default =&gt; \&amp;gen_default);</code></pre>

<p>On the other hand, the above can also be simplified by using the <code>:Default</code> directive instead:</p>

<pre><code> my @baz  :Field  :Arg(baz)   :Default($self-&gt;biz);
 my @rand :Field  :Arg(Rand)  :Default(rand)  :Type(numeric);
 my @data :Field  :Arg(Data)  :Default(gen_default);</code></pre>

<p>Using generated defaults in the <code>:InitArgs</code> hash requires the use of the same types of syntax as with the <code>Default</code> tag in an <code>:Arg</code> directive:</p>

<pre><code> my %init_args :InitArgs = (
     &#39;Baz&#39; =&gt; {
         &#39;Default&#39; =&gt; sub { $_[0]-&gt;biz },
     },
     &#39;Rand&#39; =&gt; {
         &#39;Default&#39; =&gt; sub { rand },
     },
     &#39;Data&#39; =&gt; {
         &#39;Default&#39; =&gt; \&amp;gen_default,
     },
 );</code></pre>

<h3 id="Sequential-defaults"><a id="Sequential"></a>Sequential defaults</h3>

<p>In the previous section, one of the examples is not as safe or as convenient as it should be:</p>

<pre><code> my @ID :Field  :Default(our $next; ++$next);</code></pre>

<p>The problem is the shared variable (<code>$next</code>) that&#39;s needed to track the allocation of <code>ID</code> values. Because it has to persist between calls, that variable has to be a package variable, except under Perl 5.10 or later where it could be a state variable instead:</p>

<pre><code> use feature &#39;state&#39;;

 my @ID :Field  :Default(state $next; ++$next);</code></pre>

<p>The version with the package variable is unsafe, because anyone could then spoof ID numbers just by reassigning that universally accessible variable:</p>

<pre><code>    $MyClass::next = 0;        # Spoof the next object
    my $obj = MyClass-&gt;new;    # Object now has ID 1</code></pre>

<p>The state-variable version avoids this problem, but even that version is more complicated (and hence more error-prone) than it needs to be.</p>

<p>The <code>:SequenceFrom</code> directive (which can be abbreviated to <code>:SeqFrom</code> or <code>:Seq</code>) makes it much easier to specify that an attribute&#39;s default value is taken from a linearly increasing sequence. For instance, the ID example above could be rewritten as:</p>

<pre><code> my @ID :Field  :SequenceFrom(1);</code></pre>

<p>This directive automatically creates a hidden variable, initializes it to the initial value specified, generates a sequence starting at that initial value, and then uses successive elements of that sequence each time a default value is needed for that attribute during object creation.</p>

<p>If the initial value is a scalar, then the default sequence is generated by by computing <code>$previous_value++</code>. If it is an object, it is generated by calling <code>$obj-&gt;next()</code> (or by calling <code>$obj++</code> if the object doesn&#39;t have a <code>next()</code> method).</p>

<p>This makes it simple to create a series of objects with attributes whose values default to simple numeric, alphabetic, or alphanumeric sequences, or to the sequence specified by an iterator object of some kind:</p>

<pre><code> my @ID :Field  :SeqFrom(1);                 # 1, 2, 3...

 my @ID :Field  :SeqFrom(&#39;AAA&#39;);             # &#39;AAA&#39;, &#39;AAB&#39;, &#39;AAC&#39;...

 my @ID :Field  :SeqFrom(&#39;A01&#39;);             # &#39;A01&#39;, &#39;A02&#39;, &#39;A03&#39;...

 my @ID :Field  :SeqFrom(ID_Iterator-&gt;new);  # -&gt;next, -&gt;next, -&gt;next...</code></pre>

<p>In every other respect a <code>:SequenceFrom</code> directive is just like a <code>:Default</code>. For example, it can be used in conjunction with the <code>:Arg</code> directive as follows:</p>

<pre><code> my @ID :Field  :Arg(ID)  :SeqFrom(1);</code></pre>

<p>However, not as a tag inside the <code>:Arg</code> directive:</p>

<pre><code> my @ID :Field  :Arg(&#39;Name&#39; =&gt; &#39;ID&#39;, &#39;SeqFrom&#39; =&gt; 1)   # WRONG</code></pre>

<p>For the <code>:InitArgs</code> hash, you will need to <i>roll your own</i> sequential defaults if required:</p>

<pre><code> use feature &#39;state&#39;;

 my %init_args :InitArgs = (
     &#39;Counter&#39; =&gt; {
         &#39;Default&#39; =&gt; sub { state $next; ++$next }
     },
 );</code></pre>

<h2 id="Parameter-Name-Matching"><a id="Parameter"></a>Parameter Name Matching</h2>

<p>Rather than having to rely on exact matches to parameter keys in the <code>-&gt;new()</code> argument list, you can specify a regular expressions to be used to match them to field-specific parameters:</p>

<pre><code> my @param :Field
           :Arg(&#39;Name&#39; =&gt; &#39;param&#39;, &#39;Regexp&#39; =&gt; qr/^PARA?M$/i);</code></pre>

<p>In this case, the parameter&#39;s key could be any of the following: PARAM, PARM, Param, Parm, param, parm, and so on. And the following would result in <code>$data</code> being placed in <code>My::Class</code>&#39;s <code>@param</code> field during object creation:</p>

<pre><code> my $obj = My::Class-&gt;new(&#39;Parm&#39; =&gt; $data);</code></pre>

<p>For <code>:Init</code> handled parameters, you would similarly use:</p>

<pre><code> my %init_args :InitArgs = (
     &#39;Param&#39; =&gt; {
         &#39;Regex&#39; =&gt; qr/^PARA?M$/i,
     },
 );</code></pre>

<p>In this case, the match results in <span style="white-space: nowrap;"><code>{ &#39;Param&#39; =&gt; $data }</code></span> being sent to the <code>:Init</code> subroutine as the argument hash. Note that the <code>:InitArgs</code> hash key is substituted for the original argument key. This eliminates the need for any parameter key pattern matching within the <code>:Init</code> subroutine.</p>

<p><code>Regexp</code> may be abbreviated to <code>Regex</code> or <code>Re</code>.</p>

<h2 id="Object-Pre-initialization"><a id="Object3"></a>Object Pre-initialization</h2>

<p>Occasionally, a child class may need to send a parameter to a parent class as part of object initialization. This can be accomplished by supplying a <code>:PreInit</code> labeled subroutine in the child class. These subroutines, if found, are called in order from the bottom of the class hierarchy upward (i.e., child classes first).</p>

<p>The subroutine should expect two arguments: The newly created (uninitialized) object (i.e., <code>$self</code>), and a hash ref of all the parameters from the <code>-&gt;new()</code> method call, including any additional parameters added by other <code>:PreInit</code> subroutines.</p>

<pre><code> sub pre_init :PreInit
 {
     my ($self, $args) = @_;
     ...
 }</code></pre>

<p>The parameter hash ref will not be exactly as supplied to <code>-&gt;new()</code>, but will be <i>flattened</i> into a single hash ref. For example,</p>

<pre><code> my $obj = My::Class-&gt;new(
     &#39;param_X&#39; =&gt; &#39;value_X&#39;,
     {
         &#39;param_A&#39; =&gt; &#39;value_A&#39;,
         &#39;param_B&#39; =&gt; &#39;value_B&#39;,
     },
     &#39;My::Class&#39; =&gt; { &#39;param&#39; =&gt; &#39;value&#39; },
 );</code></pre>

<p>would produce</p>

<pre><code> {
     &#39;param_X&#39; =&gt; &#39;value_X&#39;,
     &#39;param_A&#39; =&gt; &#39;value_A&#39;,
     &#39;param_B&#39; =&gt; &#39;value_B&#39;,
     &#39;My::Class&#39; =&gt; { &#39;param&#39; =&gt; &#39;value&#39; }
 }</code></pre>

<p>as the hash ref to the <code>:PreInit</code> subroutine.</p>

<p>The <code>:PreInit</code> subroutine may then add, modify or even remove any parameters from the hash ref as needed for its purposes. After all the <code>:PreInit</code> subroutines have been executed, object initialization will then proceed using the resulting parameter hash.</p>

<p>The <code>:PreInit</code> subroutine should not try to set data in its class&#39;s fields or in other class&#39;s fields (e.g., using <i>set</i> methods) as such changes will be overwritten during initialization phase which follows pre-initialization. The <code>:PreInit</code> subroutine is only intended for modifying initialization parameters prior to initialization.</p>

<h2 id="Initialization-Sequence"><a id="Initialization"></a>Initialization Sequence</h2>

<p>For the most part, object initialization can be conceptualized as proceeding from parent classes down through child classes. As such, calling child class methods from a parent class during object initialization may not work because the object will not have been fully initialized in the child classes.</p>

<p>Knowing the order of events during object initialization may help in determining when this can be done safely:</p>

<dl>

<dt id="1.-The-scalar-reference-for-the-object-is-created,-populated-with-an-&quot;Object-ID&quot;,-and-blessed-into-the-appropriate-class."><a id="1"></a><a id="The-scalar-reference-for-the-object-is-created--populated-with-an--Object-ID--and-blessed-into-the-appropriate-class"></a>1. The scalar reference for the object is created, populated with an <a href="./Object::InsideOut.html#Object-ID">&quot;Object ID&quot;</a>, and blessed into the appropriate class.</dt>
<dd>

</dd>
<dt id="2.-:PreInit-subroutines-are-called-in-order-from-the-bottom-of-the-class-hierarchy-upward-(i.e.,-child-classes-first)."><a id="2"></a><a id="PreInit-subroutines-are-called-in-order-from-the-bottom-of-the-class-hierarchy-upward--i.e.--child-classes-first"></a>2. <a href="./Object::InsideOut.html#Object-Pre-initialization">:PreInit</a> subroutines are called in order from the bottom of the class hierarchy upward (i.e., child classes first).</dt>
<dd>

</dd>
<dt id="3.-From-the-top-of-the-class-hierarchy-downward-(i.e.,-parent-classes-first),-&quot;Default-Values&quot;-are-assigned-to-fields.-(These-may-be-overwritten-by-subsequent-steps-below.)"><a id="3"></a><a id="From-the-top-of-the-class-hierarchy-downward--i.e.--parent-classes-first---Default-Values--are-assigned-to-fields.--These-may-be-overwritten-by-subsequent-steps-below"></a>3. From the top of the class hierarchy downward (i.e., parent classes first), <a href="./Object::InsideOut.html#Default-Values">&quot;Default Values&quot;</a> are assigned to fields. (These may be overwritten by subsequent steps below.)</dt>
<dd>

</dd>
<dt id="4.-From-the-top-of-the-class-hierarchy-downward,-parameters-to-the-&gt;new()-method-are-processed-for-:Arg-field-attributes-and-entries-in-the-:InitArgs-hash:"><a id="4"></a><a id="From-the-top-of-the-class-hierarchy-downward--parameters-to-the--new--method-are-processed-for-:Arg-field-attributes-and-entries-in-the-:InitArgs-hash"></a>4. From the top of the class hierarchy downward, parameters to the <code>-&gt;new()</code> method are processed for <code>:Arg</code> field attributes and entries in the <code>:InitArgs</code> hash:</dt>
<dd>

<dl>

<dt id="a.-&quot;Parameter-Preprocessing&quot;-is-performed."><a id="a"></a><a id="a.--Parameter-Preprocessing--is-performed"></a>a. <a href="./Object::InsideOut.html#Parameter-Preprocessing">&quot;Parameter Preprocessing&quot;</a> is performed.</dt>
<dd>

</dd>
<dt id="b.-Checks-for-&quot;Mandatory-Parameters&quot;-are-made."><a id="b"></a><a id="b.-Checks-for--Mandatory-Parameters--are-made"></a>b. Checks for <a href="./Object::InsideOut.html#Mandatory-Parameters">&quot;Mandatory Parameters&quot;</a> are made.</dt>
<dd>

</dd>
<dt id="c.-&quot;Default-Values&quot;-specified-in-the-:InitArgs-hash-are-added-for-subsequent-processing-by-the-:Init-subroutine."><a id="c"></a><a id="c.--Default-Values--specified-in-the-:InitArgs-hash-are-added-for-subsequent-processing-by-the-:Init-subroutine"></a>c. <a href="./Object::InsideOut.html#Default-Values">&quot;Default Values&quot;</a> specified in the <code>:InitArgs</code> hash are added for subsequent processing by the <code>:Init</code> subroutine.</dt>
<dd>

</dd>
<dt id="d.-Type-checking-is-performed."><a id="d"></a><a id="d.-Type-checking-is-performed"></a>d. <a href="./Object::InsideOut.html#TYPE-CHECKING">Type checking</a> is performed.</dt>
<dd>

</dd>
<dt id="e.-&quot;Field-Specific-Parameters&quot;-are-assigned-to-fields."><a id="e"></a><a id="e.--Field-Specific-Parameters--are-assigned-to-fields"></a>e. <a href="./Object::InsideOut.html#Field-Specific-Parameters">&quot;Field-Specific Parameters&quot;</a> are assigned to fields.</dt>
<dd>

</dd>
</dl>

</dd>
<dt id="5.-From-the-top-of-the-class-hierarchy-downward,-:Init-subroutines-are-called-with-parameters-specified-in-the-:InitArgs-hash."><a id="5"></a><a id="From-the-top-of-the-class-hierarchy-downward--:Init-subroutines-are-called-with-parameters-specified-in-the-:InitArgs-hash"></a>5. From the top of the class hierarchy downward, <a href="./Object::InsideOut.html#Object-Initialization-Subroutines">:Init</a> subroutines are called with parameters specified in the <code>:InitArgs</code> hash.</dt>
<dd>

</dd>
<dt id="6.-Checks-are-made-for-any-parameters-to-&gt;new()-that-were-not-handled-in-the-above.-(See-next-section.)"><a id="6"></a><a id="Checks-are-made-for-any-parameters-to--new--that-were-not-handled-in-the-above.--See-next-section"></a>6. Checks are made for any parameters to <code>-&gt;new()</code> that were not handled in the above. (See next section.)</dt>
<dd>

</dd>
</dl>

<h2 id="Unhandled-Parameters"><a id="Unhandled"></a>Unhandled Parameters</h2>

<p>It is an error to include any parameters to the <code>-&gt;new()</code> method that are not handled by at least one class in the hierarchy. The primary purpose of this is to catch typos in parameter names:</p>

<pre><code>  my $obj = Person-&gt;new(&#39;nane&#39; =&gt; &#39;John&#39;);   # Should be &#39;name&#39;</code></pre>

<p>The only time that checks for unhandled parameters are not made is when at least one class in the hierarchy does not have an <code>:InitArgs</code> hash <b>and</b> does not use the <code>:Arg</code> attribute on any of its fields <b>and</b> uses an <a href="./Object::InsideOut.html#Object-Initialization-Subroutines">:Init</a> subroutine for processing parameters. In such a case, it is not possible for Object::InsideOut to determine which if any of the parameters are not handled by the <code>:Init</code> subroutine.</p>

<p>If you add the following construct to the start of your application:</p>

<pre><code> BEGIN {
     no warnings &#39;once&#39;;
     $OIO::Args::Unhandled::WARN_ONLY = 1;
 }</code></pre>

<p>then unhandled parameters will only generate warnings rather than causing exceptions to be thrown.</p>

<h2 id="Modifying-:InitArgs"><a id="Modifying"></a>Modifying <code>:InitArgs</code></h2>

<p>For performance purposes, Object::InsideOut <i>normalizes</i> each class&#39;s <code>:InitArgs</code> hash by creating keys in the form of <code>&#39;_X&#39;</code> for the various options it handles (e.g., <code>&#39;_R&#39;</code> for <code>&#39;Regexp&#39;</code>).</p>

<p>If a class has the unusual requirement to modify its <code>:InitArgs</code> hash during runtime, then it must renormalize the hash after making such changes by invoking <code>Object::InsideOut::normalize()</code> on it so that Object::InsideOut will pick up the changes:</p>

<pre><code> Object::InsideOut::normalize(\%init_args);</code></pre>

<h1 id="ACCESSOR-GENERATION"><a id="ACCESSOR"></a>ACCESSOR GENERATION</h1>

<p>Accessors are object methods used to get data out of and put data into an object. You can, of course, write your own accessor code, but this can get a bit tedious, especially if your class has lots of fields. Object::InsideOut provides the capability to automatically generate accessors for you.</p>

<h2 id="Basic-Accessors"><a id="Basic"></a>Basic Accessors</h2>

<p>A <i>get</i> accessor is vary basic: It just returns the value of an object&#39;s field:</p>

<pre><code> my @data :Field;

 sub fetch_data
 {
     my $self = shift;
     return ($data[$$self]);
 }</code></pre>

<p>and you would use it as follows:</p>

<pre><code> my $data = $obj-&gt;fetch_data();</code></pre>

<p>To have Object::InsideOut generate such a <i>get</i> accessor for you, add a <code>:Get</code> attribute to the field declaration, specifying the name for the accessor in parentheses:</p>

<pre><code> my @data :Field :Get(fetch_data);</code></pre>

<p>Similarly, a <i>set</i> accessor puts data in an object&#39;s field. The <i>set</i> accessors generated by Object::InsideOut check that they are called with at least one argument. They are specified using the <code>:Set</code> attribute:</p>

<pre><code> my @data :Field :Set(store_data);</code></pre>

<p>Some programmers use the convention of naming <i>get</i> and <i>set</i> accessors using <i>get_</i> and <i>set_</i> prefixes. Such <i>standard</i> accessors can be generated using the <code>:Standard</code> attribute (which may be abbreviated to <code>:Std</code>):</p>

<pre><code> my @data :Field :Std(data);</code></pre>

<p>which is equivalent to:</p>

<pre><code> my @data :Field :Get(get_data) :Set(set_data);</code></pre>

<p>Other programmers prefer to use a single <i>combination</i> accessors that performs both functions: When called with no arguments, it <i>gets</i>, and when called with an argument, it <i>sets</i>. Object::InsideOut will generate such accessors with the <code>:Accessor</code> attribute. (This can be abbreviated to <code>:Acc</code>, or you can use <code>:Get_Set</code> or <code>:Combined</code> or <code>:Combo</code> or even <code>Mutator</code>.) For example:</p>

<pre><code> my @data :Field :Acc(data);</code></pre>

<p>The generated accessor would be used in this manner:</p>

<pre><code> $obj-&gt;data($val);           # Puts data into the object&#39;s field
 my $data = $obj-&gt;data();    # Fetches the object&#39;s field data</code></pre>

<h2 id="Set-Accessor-Return-Value"><a id="Set"></a><i>Set</i> Accessor Return Value</h2>

<p>For any of the automatically generated methods that perform <i>set</i> operations, the default for the method&#39;s return value is the value being set (i.e., the <i>new</i> value).</p>

<p>You can specify the <i>set</i> accessor&#39;s return value using the <code>Return</code> attribute parameter (which may be abbreviated to <code>Ret</code>). For example, to explicitly specify the default behavior use:</p>

<pre><code> my @data :Field :Set(&#39;Name&#39; =&gt; &#39;store_data&#39;, &#39;Return&#39; =&gt; &#39;New&#39;);</code></pre>

<p>You can specify that the accessor should return the <i>old</i> (previous) value (or <code>undef</code> if unset):</p>

<pre><code> my @data :Field :Acc(&#39;Name&#39; =&gt; &#39;data&#39;, &#39;Ret&#39; =&gt; &#39;Old&#39;);</code></pre>

<p>You may use <code>Previous</code>, <code>Prev</code> or <code>Prior</code> as synonyms for <code>Old</code>.</p>

<p>Finally, you can specify that the accessor should return the object itself:</p>

<pre><code> my @data :Field :Std(&#39;Name&#39; =&gt; &#39;data&#39;, &#39;Ret&#39; =&gt; &#39;Object&#39;);</code></pre>

<p><code>Object</code> may be abbreviated to <code>Obj</code>, and is also synonymous with <code>Self</code>.</p>

<h2 id="Method-Chaining"><a id="Method"></a>Method Chaining</h2>

<p>An obvious case where method chaining can be used is when a field is used to store an object: A method for the stored object can be chained to the <i>get</i> accessor call that retrieves that object:</p>

<pre><code> $obj-&gt;get_stored_object()-&gt;stored_object_method()</code></pre>

<p>Chaining can be done off of <i>set</i> accessors based on their return value (see above). In this example with a <i>set</i> accessor that returns the <i>new</i> value:</p>

<pre><code> $obj-&gt;set_stored_object($stored_obj)-&gt;stored_object_method()</code></pre>

<p>the <i>set_stored_object()</i> call stores the new object, returning it as well, and then the <i>stored_object_method()</i> call is invoked via the stored/returned object. The same would work for <i>set</i> accessors that return the <i>old</i> value, too, but in that case the chained method is invoked via the previously stored (and now returned) object.</p>

<p>If the <a href="https://metacpan.org/pod/Want">Want</a> module (version 0.12 or later) is available, then Object::InsideOut also tries to do <i>the right thing</i> with method chaining for <i>set</i> accessors that don&#39;t store/return objects. In this case, the object used to invoke the <i>set</i> accessor will also be used to invoke the chained method (just as though the <i>set</i> accessor were declared with <span style="white-space: nowrap;"><code>&#39;Return&#39; =&gt; &#39;Object&#39;</code></span>):</p>

<pre><code> $obj-&gt;set_data(&#39;data&#39;)-&gt;do_something();</code></pre>

<p>To make use of this feature, just add <code>use Want;</code> to the beginning of your application.</p>

<p>Note, however, that this special handling does not apply to <i>get</i> accessors, nor to <i>combination</i> accessors invoked without an argument (i.e., when used as a <i>get</i> accessor). These must return objects in order for method chaining to succeed.</p>

<h2 id=":lvalue-Accessors"><a id="lvalue-Accessors"></a>:lvalue Accessors</h2>

<p>As documented in <a href="https://metacpan.org/pod/perlsub#Lvalue-subroutines">&quot;Lvalue subroutines&quot; in perlsub</a>, an <code>:lvalue</code> subroutine returns a modifiable value. This modifiable value can then, for example, be used on the left-hand side (hence <code>LVALUE</code>) of an assignment statement, or a substitution regular expression.</p>

<p>For Perl 5.8.0 and later, Object::InsideOut supports the generation of <code>:lvalue</code> accessors such that their use in an <code>LVALUE</code> context will set the value of the object&#39;s field. Just add <code>&#39;lvalue&#39; =&gt; 1</code> to the <i>set</i> accessor&#39;s attribute. (<code>&#39;lvalue&#39;</code> may be abbreviated to <code>&#39;lv&#39;</code>.)</p>

<p>Additionally, <code>:Lvalue</code> (or its abbreviation <code>:lv</code>) may be used for a combined <i>get/set</i> <i>:lvalue</i> accessor. In other words, the following are equivalent:</p>

<pre><code> :Acc(&#39;Name&#39; =&gt; &#39;email&#39;, &#39;lvalue&#39; =&gt; 1)

 :Lvalue(email)</code></pre>

<p>Here is a detailed example:</p>

<pre><code> package Contact; {
     use Object::InsideOut;

     # Create separate a get accessor and an :lvalue set accessor
     my @name  :Field
               :Get(name)
               :Set(&#39;Name&#39; =&gt; &#39;set_name&#39;, &#39;lvalue&#39; =&gt; 1);

     # Create a standard get_/set_ pair of accessors
     #   The set_ accessor will be an :lvalue accessor
     my @phone :Field
               :Std(&#39;Name&#39; =&gt; &#39;phone&#39;, &#39;lvalue&#39; =&gt; 1);

     # Create a combined get/set :lvalue accessor
     my @email :Field
               :Lvalue(email);
 }

 package main;

 my $obj = Contact-&gt;new();

 # Use :lvalue accessors in assignment statements
 $obj-&gt;set_name()  = &#39;Jerry D. Hedden&#39;;
 $obj-&gt;set_phone() = &#39;800-555-1212&#39;;
 $obj-&gt;email()     = &#39;jdhedden AT cpan DOT org&#39;;

 # Use :lvalue accessor in substitution regexp
 $obj-&gt;email() =~ s/ AT (\w+) DOT /\@$1./;

 # Use :lvalue accessor in a &#39;substr&#39; call
 substr($obj-&gt;set_phone(), 0, 3) = &#39;888&#39;;

 print(&quot;Contact info:\n&quot;);
 print(&quot;\tName:  &quot;, $obj-&gt;name(),      &quot;\n&quot;);
 print(&quot;\tPhone: &quot;, $obj-&gt;get_phone(), &quot;\n&quot;);
 print(&quot;\tEmail: &quot;, $obj-&gt;email(),     &quot;\n&quot;);</code></pre>

<p>The use of <code>:lvalue</code> accessors requires the installation of the <a href="https://metacpan.org/pod/Want">Want</a> module (version 0.12 or later) from CPAN. See particularly the section <a href="https://metacpan.org/pod/Want#Lvalue-subroutines:">&quot;Lvalue subroutines:&quot; in Want</a> for more information.</p>

<p><code>:lvalue</code> accessors also work like regular <i>set</i> accessors in being able to accept arguments, return values, and so on:</p>

<pre><code> my @pri :Field
         :Lvalue(&#39;Name&#39; =&gt; &#39;priority&#39;, &#39;Return&#39; =&gt; &#39;Old&#39;);
  ...
 my $old_pri = $obj-&gt;priority(10);</code></pre>

<p><code>:lvalue</code> accessors can be used in <a href="./Object::InsideOut.html#Method-Chaining">method chains</a>.</p>

<p><b>Caveats</b>: While still classified as <i>experimental</i>, Perl&#39;s support for <code>:lvalue</code> subroutines has been around since 5.6.0, and a good number of CPAN modules make use of them.</p>

<p>By definition, because <code>:lvalue</code> accessors return the <i>location</i> of a field, they break encapsulation. As a result, some OO advocates eschew the use of <code>:lvalue</code> accessors.</p>

<p><code>:lvalue</code> accessors are slower than corresponding <i>non-lvalue</i> accessors. This is due to the fact that more code is needed to handle all the diverse ways in which <code>:lvalue</code> accessors may be used. (I&#39;ve done my best to optimize the generated code.) For example, here&#39;s the code that is generated for a simple combined accessor:</p>

<pre><code> *Foo::foo = sub {
     return ($$field[${$_[0]}]) if (@_ == 1);
     $$field[${$_[0]}] = $_[1];
 };</code></pre>

<p>And the corresponding code for an <code>:lvalue</code> combined accessor:</p>

<pre><code> *Foo::foo = sub :lvalue {
     my $rv = !Want::want_lvalue(0);
     Want::rreturn($$field[${$_[0]}]) if ($rv &amp;&amp; (@_ == 1));
     my $assign;
     if (my @args = Want::wantassign(1)) {
         @_ = ($_[0], @args);
         $assign = 1;
     }
     if (@_ &gt; 1) {
         $$field[${$_[0]}] = $_[1];
         Want::lnoreturn if $assign;
         Want::rreturn($$field[${$_[0]}]) if $rv;
     }
     ((@_ &gt; 1) &amp;&amp; (Want::wantref() eq &#39;OBJECT&#39;) &amp;&amp;
      !Scalar::Util::blessed($$field[${$_[0]}]))
            ? $_[0] : $$field[${$_[0]}];
 };</code></pre>

<h1 id="ALL-IN-ONE"><a id="ALL"></a>ALL-IN-ONE</h1>

<p>Parameter naming and accessor generation may be combined:</p>

<pre><code> my @data :Field :All(data);</code></pre>

<p>This is <i>syntactic shorthand</i> for:</p>

<pre><code> my @data :Field :Arg(data) :Acc(data);</code></pre>

<p>If you want the accessor to be <code>:lvalue</code>, use:</p>

<pre><code> my @data :Field :LV_All(data);</code></pre>

<p>If <i>standard</i> accessors are desired, use:</p>

<pre><code> my @data :Field :Std_All(data);</code></pre>

<p>Attribute parameters affecting the <i>set</i> accessor may also be used. For example, if you want <i>standard</i> accessors with an <code>:lvalue</code> <i>set</i> accessor:</p>

<pre><code> my @data :Field :Std_All(&#39;Name&#39; =&gt; &#39;data&#39;, &#39;Lvalue&#39; =&gt; 1);</code></pre>

<p>If you want a combined accessor that returns the <i>old</i> value on <i>set</i> operations:</p>

<pre><code> my @data :Field :All(&#39;Name&#39; =&gt; &#39;data&#39;, &#39;Ret&#39; =&gt; &#39;Old&#39;);</code></pre>

<p>And so on.</p>

<p>If you need to add attribute parameters that affect the <code>:Arg</code> portion (e.g., <code>Default</code>, <code>Mandatory</code>, etc.), then you cannot use <code>:All</code>. Fall back to using the separate attributes. For example:</p>

<pre><code> my @data :Field :Arg(&#39;Name&#39; =&gt; &#39;data&#39;, &#39;Mand&#39; =&gt; 1)
                 :Acc(&#39;Name&#39; =&gt; &#39;data&#39;, &#39;Ret&#39; =&gt; &#39;Old&#39;);</code></pre>

<h1 id="READONLY-FIELDS"><a id="READONLY"></a>READONLY FIELDS</h1>

<p>If you want to declare a <i>read-only</i> field (i.e., one that can be initialized and retrieved, but which doesn&#39;t have a <i>set</i> accessor):</p>

<pre><code> my @data :Field :Arg(data) :Get(data);</code></pre>

<p>there is a <i>syntactic shorthand</i> for that, too:</p>

<pre><code> my @data :Field :ReadOnly(data);</code></pre>

<p>or just:</p>

<pre><code> my @data :Field :RO(data);</code></pre>

<p>If a <i>standard</i> <i>get</i> accessor is desired, use:</p>

<pre><code> my @data :Field :Std_RO(data);</code></pre>

<p>For obvious reasons, attribute parameters affecting the <i>set</i> accessor cannot be used with read-only fields, nor can <code>:ReadOnly</code> be combined with <code>:LValue</code>.</p>

<p>As with <code>:All</code>, if you need to add attribute parameters that affect the <code>:Arg</code> portion then you cannot use the <code>:RO</code> shorthand: Fall back to using the separate attributes in such cases. For example:</p>

<pre><code> my @data :Field :Arg(&#39;Name&#39; =&gt; &#39;data&#39;, &#39;Mand&#39; =&gt; 1)
                 :Get(&#39;Name&#39; =&gt; &#39;data&#39;);</code></pre>

<h1 id="DELEGATORS">DELEGATORS</h1>

<p>In addition to autogenerating accessors for a given field, you can also autogenerate <i>delegators</i> to that field. A delegator is an accessor that forwards its call to one of the object&#39;s fields.</p>

<p>For example, if your <i>Car</i> object has an <code>@engine</code> field, then you might need to send all acceleration requests to the <i>Engine</i> object stored in that field. Likewise, all braking requests may need to be forwarded to <i>Car</i>&#39;s field that stores the <i>Brakes</i> object:</p>

<pre><code> package Car; {
     use Object::InsideOut;

     my @engine :Field :Get(engine);
     my @brakes :Field :Get(brakes);

     sub _init :Init(private)  {
         my ($self, $args) = @_;

         $self-&gt;engine(Engine-&gt;new());
         $self-&gt;brakes(Brakes-&gt;new());
     }

     sub accelerate {
         my ($self) = @_;
         $self-&gt;engine-&gt;accelerate();
     }

     sub decelerate {
         my ($self) = @_;
         $self-&gt;engine-&gt;decelerate();
     }

     sub brake {
         my ($self, $foot_pressure) = @_;
         $self-&gt;brakes-&gt;brake($foot_pressure);
     }
 }</code></pre>

<p>If the <i>Car</i> needs to forward other method calls to its <i>Engine</i> or <i>Brakes</i>, this quickly becomes tedious, repetitive, and error-prone. So, instead, you can just tell Object::InsideOut that a particular method should be automatically forwarded to a particular field, by specifying a <code>:Handles</code> attribute:</p>

<pre><code> package Car; {
     use Object::InsideOut;

     my @engine :Field
                :Get(engine)
                :Handles(accelerate, decelerate);
     my @brakes :Field
                :Get(brakes)
                :Handles(brake);

     sub _init :Init(private)  {
         my ($self, $args) = @_;

         $self-&gt;engine(Engine-&gt;new());
         $self-&gt;brakes(Brakes-&gt;new());
     }
 }</code></pre>

<p>This option generates and installs a single delegator method for each of its arguments, so the second example has exactly the same effect as the first example. The delegator simply calls the corresponding method on the object stored in the field, passing it the same argument list it received.</p>

<p>Sometimes, however, you may need to delegate a particular method to a field, but under a different name. For example, if the <i>Brake</i> class provides an <code>engage()</code> method, rather than a <code>brake()</code> method, then you&#39;d need <code>Car::brake()</code> to be implemented as:</p>

<pre><code>     sub brake {
         my ($self, $foot_pressure) = @_;
         $self-&gt;brakes-&gt;engage($foot_pressure);
     }</code></pre>

<p>You can achieve that using the <code>:Handles</code> attribute, like so:</p>

<pre><code>     my @brakes :Field
                :Get(brakes)
                :Handles(brake--&gt;engage);</code></pre>

<p>The long arrow version still creates a delegator method <code>brake()</code>, but makes that method delegate to your <i>Brakes</i> object by calling its <code>engage()</code> method instead.</p>

<p>If you are delegating a large number of methods to a particular field, the <code>:Handles</code> declarations soon become tedious:</p>

<pre><code> my @onboard_computer :Field :Get(comp)
                      :Type(Computer::Onboard)
                      :Handles(engine_monitor engine_diagnostics)
                      :Handles(engine_control airbag_deploy)
                      :Handles(GPS_control GPS_diagnostics GPS_reset)
                      :Handles(climate_control reversing_camera)
                      :Handles(cruise_control auto_park)
                      :Handles(iPod_control cell_phone_connect);</code></pre>

<p>And, of course, every time the interface of the <code>Computer::Onboard</code> class changes, you have to change those <code>:Handles</code> declarations, too.</p>

<p>Sometimes, all you really want to say is: &quot;This field should handle anything it <i>can</i> handle&quot;. To do that, you write:</p>

<pre><code> my @onboard_computer :Field :Get(comp)
                      :Type(Computer::Onboard)
                      :Handles(Computer::Onboard);</code></pre>

<p>That is, if a <code>:Handles</code> directive is given a name that includes a <code>::</code>, it treats that name as a class name, rather than a method name. Then it checks that class&#39;s metadata (see <a href="https://metacpan.org/pod/INTROSPECTION">INTROSPECTION</a>), retrieves a list of all the method names from the class, and uses that as the list of method names to delegate.</p>

<p>Unlike an explicit <code>:Handles( method_name )</code>, a <code>:Handles( Class::Name )</code> is tolerant of name collisions. If any method of <code>Class::Name</code> has the same name as another method or delegator that has already been installed in the current class, then <code>:Handles</code> just silently ignores that particular method, and doesn&#39;t try to replace the existing one. In other words, a <code>:Handles(Class::Name)</code> won&#39;t install a delegator to a method in <code>Class::Name</code> if that method is already being handled somewhere else by the current class.</p>

<p>For classes that don&#39;t have a <code>::</code> in their name (e.g., <code>DateTime</code> and <code>POE</code>), just append a <code>::</code> to the class name:</p>

<pre><code> my @init_time :Field :Get(init_time)
                      :Type(    DateTime        )
                      :Default( DateTime-&gt;now() )
                      :Handles( DateTime::      );</code></pre>

<p>Note that, when using the class-based version of <code>:Handles</code>, every method is delegated with its name unchanged. If some of the object&#39;s methods should be delegated under different names, you have to specify that explicitly (and beforehand):</p>

<pre><code> my @onboard_computer :Field :Get(comp) :Type(Computer::Onboard)
                # rename this method when delegating...
                      :Handles( iPod_control--&gt;get_iPod )
                # delegate everything else with names unchanged...
                      :Handles( Computer::Onboard );</code></pre>

<p><code>Handles</code> may be abbreviated to <code>Handle</code> or <code>Hand</code>.</p>

<p>NOTES: Failure to add the appropriate object to the delegation field will lead to errors such as: <b>Can&#39;t call method &quot;bar&quot; on an undefined value</b>.</p>

<p>Typos in <code>:Handles</code> attribute declarations will lead to errors such as: <b>Can&#39;t locate object method &quot;bat&quot; via package &quot;Foo&quot;</b>. Adding an object of the wrong class to the delegation field will lead to the same error, but can be avoided by adding a <code>:Type</code> attribute for the appropriate class.</p>

<h1 id="PERMISSIONS">PERMISSIONS</h1>

<h2 id="Restricted-and-Private-Accessors"><a id="Restricted"></a>Restricted and Private Accessors</h2>

<p>By default, <a href="./Object::InsideOut.html#ACCESSOR-GENERATION">automatically generated accessors</a>, can be called at any time. In other words, their access permission is <i>public</i>.</p>

<p>If desired, accessors can be made <i>restricted</i> - in which case they can only be called from within the class and any child classes in the hierarchy that are derived from it - or <i>private</i> - such that they can only be called from within the accessors&#39; class. Here are examples of the syntax for adding permissions:</p>

<pre><code> my @data     :Field :Std(&#39;Name&#39; =&gt; &#39;data&#39;,     &#39;Permission&#39; =&gt; &#39;private&#39;);
 my @info     :Field :Set(&#39;Name&#39; =&gt; &#39;set_info&#39;, &#39;Perm&#39; =&gt; &#39;restricted&#39;);
 my @internal :Field :Acc(&#39;Name&#39; =&gt; &#39;internal&#39;, &#39;Private&#39; =&gt; 1);
 my @state    :Field :Get(&#39;Name&#39; =&gt; &#39;state&#39;,    &#39;Restricted&#39; =&gt; 1);</code></pre>

<p>When creating a <i>standard</i> pair of <i>get_/set_</i> accessors, the permission setting is applied to both accessors. If different permissions are required on the two accessors, then you&#39;ll have to use separate <code>:Get</code> and <code>:Set</code> attributes on the field.</p>

<pre><code> # Create a private set method
 #  and a restricted get method on the &#39;foo&#39; field
 my @foo :Field
         :Set(&#39;Name&#39; =&gt; &#39;set_foo&#39;, &#39;Priv&#39; =&gt; 1)
         :Get(&#39;Name&#39; =&gt; &#39;get_foo&#39;, &#39;Rest&#39; =&gt; 1);

 # Create a restricted set method
 #  and a public get method on the &#39;bar&#39; field
 my %bar :Field
         :Set(&#39;Name&#39; =&gt; &#39;set_bar&#39;, &#39;Perm&#39; =&gt; &#39;restrict&#39;)
         :Get(get_bar);</code></pre>

<p><code>Permission</code> may be abbreviated to <code>Perm</code>; <code>Private</code> may be abbreviated to <code>Priv</code>; and <code>Restricted</code> may be abbreviated to <code>Restrict</code>.</p>

<h2 id="Restricted-and-Private-Methods"><a id="Restricted1"></a>Restricted and Private Methods</h2>

<p>In the same vein as describe above, access to methods can be narrowed by use of <code>:Restricted</code> and <code>:Private</code> attributes.</p>

<pre><code> sub foo :Restricted
 {
     my $self = shift;
     ...
 }</code></pre>

<p>Without either of these attributes, most methods have <i>public</i> access. If desired, you may explicitly label them with the <code>:Public</code> attribute.</p>

<h2 id="Exemptions">Exemptions</h2>

<p>It is also possible to specify classes that are exempt from the <i>Restricted</i> and <i>Private</i> access permissions (i.e., the method may be called from those classes as well):</p>

<pre><code> my %foo :Field
         :Acc(&#39;Name&#39; =&gt; &#39;foo&#39;, &#39;Perm&#39; =&gt; &#39;Restrict(Exempt::Class)&#39;)
         :Get(get_bar);

 sub bar :Private(Some::Class, Another::Class)
 {
     my $self = shift;
     ...
 }</code></pre>

<p>An example of when this might be needed is with delegation mechanisms.</p>

<h2 id="Hidden-Methods"><a id="Hidden"></a>Hidden Methods</h2>

<p>For subroutines marked with the following attributes (most of which are discussed later in this document):</p>

<dl>

<dt id=":ID"><a id="ID"></a>:ID</dt>
<dd>

</dd>
<dt id=":PreInit"><a id="PreInit"></a>:PreInit</dt>
<dd>

</dd>
<dt id=":Init"><a id="Init"></a>:Init</dt>
<dd>

</dd>
<dt id=":Replicate"><a id="Replicate"></a>:Replicate</dt>
<dd>

</dd>
<dt id=":Destroy"><a id="Destroy"></a>:Destroy</dt>
<dd>

</dd>
<dt id=":Automethod"><a id="Automethod"></a>:Automethod</dt>
<dd>

</dd>
<dt id=":Dumper"><a id="Dumper"></a>:Dumper</dt>
<dd>

</dd>
<dt id=":Pumper"><a id="Pumper"></a>:Pumper</dt>
<dd>

</dd>
<dt id=":MOD_*_ATTRS"><a id="MOD_-_ATTRS"></a>:MOD_*_ATTRS</dt>
<dd>

</dd>
<dt id=":FETCH_*_ATTRS"><a id="FETCH_-_ATTRS"></a>:FETCH_*_ATTRS</dt>
<dd>

</dd>
</dl>

<p>Object::InsideOut normally renders them uncallable (hidden) to class and application code (as they should normally only be needed by Object::InsideOut itself). If needed, this behavior can be overridden by adding the <code>Public</code>, <code>Restricted</code> or <code>Private</code> attribute parameters:</p>

<pre><code> sub _init :Init(private)    # Callable from within this class
 {
     my ($self, $args) = @_;

     ...
 }</code></pre>

<h2 id="Restricted-and-Private-Classes"><a id="Restricted2"></a>Restricted and Private Classes</h2>

<p>Permission for object creation on a class can be narrowed by adding a <code>:Restricted</code> or <code>:Private</code> flag to its <span style="white-space: nowrap;"><code>use Object::InsideOut ...</code></span> declaration. This basically adds <code>:Restricted/:Private</code> permissions on the <code>-&gt;new()</code> method for that class. Exemptions are also supported.</p>

<pre><code> package Foo; {
     use Object::InsideOut;
     ...
 }

 package Bar; {
     use Object::InsideOut &#39;Foo&#39;, &#39;:Restricted(Ping, Pong)&#39;;
     ...
 }</code></pre>

<p>In the above, class <code>Bar</code> inherits from class <code>Foo</code>, and its constructor is restricted to itself, classes that inherit from <code>Bar</code>, and the classes <code>Ping</code> and <code>Pong</code>.</p>

<p>As constructors are inherited, any class that inherits from <code>Bar</code> would also be a restricted class. To overcome this, any child class would need to add its own permission declaration:</p>

<pre><code> package Baz; {
     use Object::InsideOut qw/Bar :Private(My::Class)/;
     ...
 }</code></pre>

<p>Here, class <code>Baz</code> inherits from class <code>Bar</code>, and its constructor is restricted to itself (i.e., private) and class <code>My::Class</code>.</p>

<p>Inheriting from a <code>:Private</code> class is permitted, but objects cannot be created for that class unless it has a permission declaration of its own:</p>

<pre><code> package Zork; {
     use Object::InsideOut qw/:Public Baz/;
     ...
 }</code></pre>

<p>Here, class <code>Zork</code> inherits from class <code>Baz</code>, and its constructor has unrestricted access. (In general, don&#39;t use the <code>:Public</code> declaration for a class except to overcome constructor permissions inherited from parent classes.)</p>

<h1 id="TYPE-CHECKING"><a id="TYPE"></a>TYPE CHECKING</h1>

<p>Object::InsideOut can be directed to add type-checking code to the <i>set/combined</i> accessors it generates, and to perform type checking on object initialization parameters.</p>

<h2 id="Field-Type-Checking"><a id="Field2"></a>Field Type Checking</h2>

<p>Type checking for a field can be specified by adding the <code>:Type</code> attribute to the field declaration:</p>

<pre><code> my @count :Field :Type(numeric);

 my @objs :Field :Type(list(My::Class));</code></pre>

<p>The <code>:Type</code> attribute results in type checking code being added to <i>set/combined</i> accessors generated by Object::InsideOut, and will perform type checking on object initialization parameters processed by the <code>:Arg</code> attribute.</p>

<p>Available Types are:</p>

<dl>

<dt id="&#39;scalar&#39;"><a id="scalar"></a>&#39;scalar&#39;</dt>
<dd>

<p>Permits anything that is not a reference.</p>

</dd>
<dt id="&#39;numeric&#39;"><a id="numeric"></a>&#39;numeric&#39;</dt>
<dd>

<p>Can also be specified as <code>Num</code> or <code>Number</code>. This uses <a href="https://metacpan.org/pod/Scalar::Util#looks_like_number-EXPR">Scalar::Util::looks_like_number()</a> to test the input value.</p>

</dd>
<dt id="&#39;list&#39;-or-&#39;array&#39;"><a id="list--or--array"></a>&#39;list&#39; or &#39;array&#39;</dt>
<dd>

</dd>
<dt id="&#39;list(_subtype_)&#39;-or-&#39;array(_subtype_)&#39;"><a id="list-_subtype_--or--array-_subtype_"></a>&#39;list(_subtype_)&#39; or &#39;array(_subtype_)&#39;</dt>
<dd>

<p>This type permits an accessor to accept multiple values (which are then placed in an array ref) or a single array ref.</p>

<p>For object initialization parameters, it permits a single value (which is then placed in an array ref) or an array ref.</p>

<p>When specified, the contents of the resulting array ref are checked against the specified subtype:</p>

<dl>

<dt id="&#39;scalar&#39;1"><a id="scalar1"></a>&#39;scalar&#39;</dt>
<dd>

<p>Same as for the basic type above.</p>

</dd>
<dt id="&#39;numeric&#39;1"><a id="numeric1"></a>&#39;numeric&#39;</dt>
<dd>

<p>Same as for the basic type above.</p>

</dd>
<dt id="A-class-name"><a id="A"></a>A class name</dt>
<dd>

<p>Same as for the basic type below.</p>

</dd>
<dt id="A-reference-type"><a id="A1"></a>A reference type</dt>
<dd>

<p>Any reference type (in all caps) as returned by <a href="functions/CORE.html#ref-EXPR">ref()</a>).</p>

</dd>
</dl>

</dd>
<dt id="&#39;ARRAY_ref&#39;"><a id="ARRAY_ref"></a>&#39;ARRAY_ref&#39;</dt>
<dd>

</dd>
<dt id="&#39;ARRAY_ref(_subtype_)&#39;"><a id="ARRAY_ref-_subtype_"></a>&#39;ARRAY_ref(_subtype_)&#39;</dt>
<dd>

<p>This specifies that only a single array reference is permitted. Can also be specified as <code>ARRAYref</code>.</p>

<p>When specified, the contents of the array ref are checked against the specified subtype as per the above.</p>

</dd>
<dt id="&#39;HASH&#39;"><a id="HASH"></a>&#39;HASH&#39;</dt>
<dd>

<p>This type permits an accessor to accept multiple <span style="white-space: nowrap;"><code>key =&gt; value</code></span> pairs (which are then placed in a hash ref) or a single hash ref.</p>

<p>For object initialization parameters, only a single ref is permitted.</p>

</dd>
<dt id="&#39;HASH_ref&#39;"><a id="HASH_ref"></a>&#39;HASH_ref&#39;</dt>
<dd>

<p>This specifies that only a single hash reference is permitted. Can also be specified as <code>HASHref</code>.</p>

</dd>
<dt id="&#39;SCALAR_ref&#39;"><a id="SCALAR_ref"></a>&#39;SCALAR_ref&#39;</dt>
<dd>

<p>This type permits an accessor to accept a single scalar reference. Can also be specified as <code>SCALARref</code>.</p>

</dd>
<dt id="A-class-name1"><a id="A2"></a>A class name</dt>
<dd>

<p>This permits only an object of the specified class, or one of its sub-classes (i.e., type checking is done using <code>-&gt;isa()</code>). For example, <code>My::Class</code>. The class name <code>UNIVERSAL</code> permits any object. The class name <code>Object::InsideOut</code> permits any object generated by an Object::InsideOut class.</p>

</dd>
<dt id="Other-reference-type"><a id="Other"></a>Other reference type</dt>
<dd>

<p>This permits only a reference of the specified type (as returned by <a href="functions/CORE.html#ref-EXPR">ref()</a>). The type must be specified in all caps. For example, <code>CODE</code>.</p>

</dd>
</dl>

<p>The <code>:Type</code> attribute can also be supplied with a code reference to provide custom type checking. The code ref may either be in the form of an anonymous subroutine, or a fully-qualified subroutine name. The result of executing the code ref on the input argument should be a boolean value. Here&#39;s some examples:</p>

<pre><code> package My::Class; {
     use Object::InsideOut;

     # Type checking using an anonymous subroutine
     #  (This checks that the argument is an object)
     my @data :Field :Type(sub { Scalar::Util::blessed($_[0]) })
                     :Acc(data);

     # Type checking using a fully-qualified subroutine name
     my @num  :Field :Type(\&amp;My::Class::positive)
                     :Acc(num);

     # The type checking subroutine may be made &#39;Private&#39;
     sub positive :Private
     {
         return (Scalar::Util::looks_like_number($_[0]) &amp;&amp;
                 ($_[0] &gt; 0));
     }
 }</code></pre>

<h2 id="Type-Checking-on-:Init-Parameters"><a id="Type"></a>Type Checking on <code>:Init</code> Parameters</h2>

<p>For object initialization parameters that are sent to the <code>:Init</code> subroutine during object initialization, the parameter&#39;s type can be specified in the <code>:InitArgs</code> hash for that parameter using the same types as specified in the previous section. For example:</p>

<pre><code> my %init_args :InitArgs = (
     &#39;COUNT&#39; =&gt; {
         &#39;Type&#39; =&gt; &#39;numeric&#39;,
     },
     &#39;OBJS&#39; =&gt; {
         &#39;Type&#39; =&gt; &#39;list(My::Class)&#39;,
     },
 );</code></pre>

<p>One exception involves custom type checking: If referenced in an <code>:InitArgs</code> hash, the type checking subroutine cannot be made <code>:Private</code>:</p>

<pre><code> package My::Class; {
     use Object::InsideOut;

     sub check_type   # Cannot be :Private
     {
        ...
     }

     my %init_args :InitArgs = (
         &#39;ARG&#39; =&gt; {
             &#39;Type&#39; =&gt; \&amp;check_type,
         },
     );

     ...
 }</code></pre>

<p>Also, as shown, it also doesn&#39;t have to be a fully-qualified name.</p>

<h1 id="CUMULATIVE-METHODS"><a id="CUMULATIVE"></a>CUMULATIVE METHODS</h1>

<p>Normally, methods with the same name in a class hierarchy are masked (i.e., overridden) by inheritance - only the method in the most-derived class is called. With cumulative methods, this masking is removed, and the same-named method is called in each of the classes within the hierarchy. The return results from each call (if any) are then gathered together into the return value for the original method call. For example,</p>

<pre><code> package My::Class; {
     use Object::InsideOut;

     sub what_am_i :Cumulative
     {
         my $self = shift;

         my $ima = (ref($self) eq __PACKAGE__)
                     ? q/I was created as a /
                     : q/My top class is /;

         return ($ima . __PACKAGE__);
     }
 }

 package My::Foo; {
     use Object::InsideOut &#39;My::Class&#39;;

     sub what_am_i :Cumulative
     {
         my $self = shift;

         my $ima = (ref($self) eq __PACKAGE__)
                     ? q/I was created as a /
                     : q/I&#39;m also a /;

         return ($ima . __PACKAGE__);
     }
 }

 package My::Child; {
     use Object::InsideOut &#39;My::Foo&#39;;

     sub what_am_i :Cumulative
     {
         my $self = shift;

         my $ima = (ref($self) eq __PACKAGE__)
                     ? q/I was created as a /
                     : q/I&#39;m in class /;

         return ($ima . __PACKAGE__);
     }
 }

 package main;

 my $obj = My::Child-&gt;new();
 my @desc = $obj-&gt;what_am_i();
 print(join(&quot;\n&quot;, @desc), &quot;\n&quot;);</code></pre>

<p>produces:</p>

<pre><code> My top class is My::Class
 I&#39;m also a My::Foo
 I was created as a My::Child</code></pre>

<p>When called in a list context (as in the above), the return results of cumulative methods are accumulated, and returned as a list.</p>

<p>In a scalar context, a results object is returned that segregates the results by class for each of the cumulative method calls. Through overloading, this object can then be dereferenced as an array, hash, string, number, or boolean. For example, the above could be rewritten as:</p>

<pre><code> my $obj = My::Child-&gt;new();
 my $desc = $obj-&gt;what_am_i();        # Results object
 print(join(&quot;\n&quot;, @{$desc}), &quot;\n&quot;);   # Dereference as an array</code></pre>

<p>The following uses hash dereferencing:</p>

<pre><code> my $obj = My::Child-&gt;new();
 my $desc = $obj-&gt;what_am_i();
 while (my ($class, $value) = each(%{$desc})) {
     print(&quot;Class $class reports:\n\t$value\n&quot;);
 }</code></pre>

<p>and produces:</p>

<pre><code> Class My::Class reports:
         My top class is My::Class
 Class My::Child reports:
         I was created as a My::Child
 Class My::Foo reports:
         I&#39;m also a My::Foo</code></pre>

<p>As illustrated above, cumulative methods are tagged with the <code>:Cumulative</code> attribute (or <span style="white-space: nowrap;"><code>:Cumulative(top down)</code></span>), and propagate from the <i>top down</i> through the class hierarchy (i.e., from the parent classes down through the child classes). If tagged with <span style="white-space: nowrap;"><code>:Cumulative(bottom up)</code></span>, they will propagated from the object&#39;s class upward through the parent classes.</p>

<h1 id="CHAINED-METHODS"><a id="CHAINED"></a>CHAINED METHODS</h1>

<p>In addition to <code>:Cumulative</code>, Object::InsideOut provides a way of creating methods that are chained together so that their return values are passed as input arguments to other similarly named methods in the same class hierarchy. In this way, the chained methods act as though they were <i>piped</i> together.</p>

<p>For example, imagine you had a method called <code>format_name</code> that formats some text for display:</p>

<pre><code> package Subscriber; {
     use Object::InsideOut;

     sub format_name {
         my ($self, $name) = @_;

         # Strip leading and trailing whitespace
         $name =~ s/^\s+//;
         $name =~ s/\s+$//;

         return ($name);
     }
 }</code></pre>

<p>And elsewhere you have a second class that formats the case of names:</p>

<pre><code> package Person; {
     use Lingua::EN::NameCase qw(nc);
     use Object::InsideOut;

     sub format_name
     {
         my ($self, $name) = @_;

         # Attempt to properly case names
         return (nc($name));
     }
 }</code></pre>

<p>And you decide that you&#39;d like to perform some formatting of your own, and then have all the parent methods apply their own formatting. Normally, if you have a single parent class, you&#39;d just call the method directly with <code>$self-&gt;SUPER::format_name($name)</code>, but if you have more than one parent class you&#39;d have to explicitly call each method directly:</p>

<pre><code> package Customer; {
     use Object::InsideOut qw(Person Subscriber);

     sub format_name
     {
         my ($self, $name) = @_;

         # Compress all whitespace into a single space
         $name =~ s/\s+/ /g;

         $name = $self-&gt;Subscriber::format_name($name);
         $name = $self-&gt;Person::format_name($name);

         return $name;
     }
 }</code></pre>

<p>With Object::InsideOut, you&#39;d add the <code>:Chained</code> attribute to each class&#39;s <code>format_name</code> method, and the methods will be chained together automatically:</p>

<pre><code> package Subscriber; {
     use Object::InsideOut;

     sub format_name :Chained
     {
         my ($self, $name) = @_;

         # Strip leading and trailing whitespace
         $name =~ s/^\s+//;
         $name =~ s/\s+$//;

         return ($name);
     }
 }

 package Person; {
     use Lingua::EN::NameCase qw(nc);
     use Object::InsideOut;

     sub format_name :Chained
     {
         my ($self, $name) = @_;

         # Attempt to properly case names
         return (nc($name));
     }
 }

 package Customer; {
     use Object::InsideOut qw(Person Subscriber);

     sub format_name :Chained
     {
         my ($self, $name) = @_;

         # Compress all whitespace into a single space
         $name =~ s/\s+/ /g;

         return ($name);
     }
 }</code></pre>

<p>So passing in someone&#39;s name to <code>format_name</code> in <code>Customer</code> would cause leading and trailing whitespace to be removed, then the name to be properly cased, and finally whitespace to be compressed to a single space. The resulting <code>$name</code> would be returned to the caller:</p>

<pre><code> my ($name) = $obj-&gt;format_name($name_raw);</code></pre>

<p>Unlike <code>:Cumulative</code> methods, <code>:Chained</code> methods <b>always</b> returns an array - even if there is only one value returned. Therefore, <code>:Chained</code> methods should always be called in an array context, as illustrated above.</p>

<p>The default direction is to chain methods from the parent classes at the top of the class hierarchy down through the child classes. You may use the attribute <span style="white-space: nowrap;"><code>:Chained(top down)</code></span> to make this more explicit.</p>

<p>If you label the method with the <span style="white-space: nowrap;"><code>:Chained(bottom up)</code></span> attribute, then the chained methods are called starting with the object&#39;s class and working upward through the parent classes in the class hierarchy, similar to how <span style="white-space: nowrap;"><code>:Cumulative(bottom up)</code></span> works.</p>

<h1 id="ARGUMENT-MERGING"><a id="ARGUMENT"></a>ARGUMENT MERGING</h1>

<p>As mentioned under <a href="./Object::InsideOut.html#Object-Creation">&quot;Object Creation&quot;</a>, the <code>-&gt;new()</code> method can take parameters that are passed in as combinations of <span style="white-space: nowrap;"><code>key =&gt; value</code></span> pairs and/or hash refs:</p>

<pre><code> my $obj = My::Class-&gt;new(
     &#39;param_X&#39; =&gt; &#39;value_X&#39;,
     &#39;param_Y&#39; =&gt; &#39;value_Y&#39;,
     {
         &#39;param_A&#39; =&gt; &#39;value_A&#39;,
         &#39;param_B&#39; =&gt; &#39;value_B&#39;,
     },
     {
         &#39;param_Q&#39; =&gt; &#39;value_Q&#39;,
     },
 );</code></pre>

<p>The parameters are <i>merged</i> into a single hash ref before they are processed.</p>

<p>Adding the <code>:MergeArgs</code> attribute to your methods gives them a similar capability. Your method will then get two arguments: The object and a single hash ref of the <i>merged</i> arguments. For example:</p>

<pre><code> package Foo; {
     use Object::InsideOut;

     ...

     sub my_method :MergeArgs {
         my ($self, $args) = @_;

         my $param = $args-&gt;{&#39;param&#39;};
         my $data  = $args-&gt;{&#39;data&#39;};
         my $flag  = $args-&gt;{&#39;flag&#39;};
         ...
     }
 }

 package main;

 my $obj = Foo-&gt;new(...);

 $obj-&gt;my_method( { &#39;data&#39; =&gt; 42,
                    &#39;flag&#39; =&gt; &#39;true&#39; },
                  &#39;param&#39; =&gt; &#39;foo&#39; );</code></pre>

<h1 id="ARGUMENT-VALIDATION"><a id="ARGUMENT1"></a>ARGUMENT VALIDATION</h1>

<p>A number of users have asked about argument validation for methods: <a href="http://www.cpanforum.com/threads/3204">http://www.cpanforum.com/threads/3204</a>. For this, I recommend using <a href="https://metacpan.org/pod/Params::Validate">Params::Validate</a>:</p>

<pre><code> package Foo; {
     use Object::InsideOut;
     use Params::Validate &#39;:all&#39;;

     sub foo
     {
         my $self = shift;
         my %args = validate(@_, { bar =&gt; 1 });
         my $bar = $args{bar};
         ...
     }
 }</code></pre>

<p>Using <a href="https://metacpan.org/pod/Attribute::Params::Validate">Attribute::Params::Validate</a>, attributes are used for argument validation specifications:</p>

<pre><code> package Foo; {
     use Object::InsideOut;
     use Attribute::Params::Validate;

     sub foo :method :Validate(bar =&gt; 1)
     {
         my $self = shift;
         my %args = @_;
         my $bar = $args{bar};
         ...
     }
 }</code></pre>

<p>Note that in the above, Perl&#39;s <code>:method</code> attribute (in all lowercase) is needed.</p>

<p>There is some incompatibility between Attribute::Params::Validate and some of Object::InsideOut&#39;s attributes. Namely, you cannot use <code>:Validate</code> with <code>:Private</code>, <code>:Restricted</code>, <code>:Cumulative</code>, <code>:Chained</code> or <code>:MergeArgs</code>. In these cases, use the <code>validate()</code> function from <a href="https://metacpan.org/pod/Params::Validate">Params::Validate</a> instead.</p>

<h1 id="AUTOMETHODS">AUTOMETHODS</h1>

<p>There are significant issues related to Perl&#39;s <code>AUTOLOAD</code> mechanism that cause it to be ill-suited for use in a class hierarchy. Therefore, Object::InsideOut implements its own <code>:Automethod</code> mechanism to overcome these problems.</p>

<p>Classes requiring <code>AUTOLOAD</code>-type capabilities must provided a subroutine labeled with the <code>:Automethod</code> attribute. The <code>:Automethod</code> subroutine will be called with the object and the arguments in the original method call (the same as for <code>AUTOLOAD</code>). The <code>:Automethod</code> subroutine should return either a subroutine reference that implements the requested method&#39;s functionality, or else just end with <code>return;</code> to indicate that it doesn&#39;t know how to handle the request.</p>

<p>Using its own <code>AUTOLOAD</code> subroutine (which is exported to every class), Object::InsideOut walks through the class tree, calling each <code>:Automethod</code> subroutine, as needed, to fulfill an unimplemented method call.</p>

<p>The name of the method being called is passed as <code>$_</code> instead of <code>$AUTOLOAD</code>, and is <i>not</i> prefixed with the class name. If the <code>:Automethod</code> subroutine also needs to access the <code>$_</code> from the caller&#39;s scope, it is available as <code>$CALLER::_</code>.</p>

<p>Automethods can also be made to act as <a href="./Object::InsideOut.html#CUMULATIVE-METHODS">&quot;CUMULATIVE METHODS&quot;</a> or <a href="./Object::InsideOut.html#CHAINED-METHODS">&quot;CHAINED METHODS&quot;</a>. In these cases, the <code>:Automethod</code> subroutine should return two values: The subroutine ref to handle the method call, and a string designating the type of method. The designator has the same form as the attributes used to designate <code>:Cumulative</code> and <code>:Chained</code> methods:</p>

<pre><code> &#39;:Cumulative&#39;  or  &#39;:Cumulative(top down)&#39;
 &#39;:Cumulative(bottom up)&#39;
 &#39;:Chained&#39;     or  &#39;:Chained(top down)&#39;
 &#39;:Chained(bottom up)&#39;</code></pre>

<p>The following skeletal code illustrates how an <code>:Automethod</code> subroutine could be structured:</p>

<pre><code> sub _automethod :Automethod
 {
     my $self = shift;
     my @args = @_;

     my $method_name = $_;

     # This class can handle the method directly
     if (...) {
         my $handler = sub {
             my $self = shift;
             ...
             return ...;
         };

         ### OPTIONAL ###
         # Install the handler so it gets called directly next time
         # no strict refs;
         # *{__PACKAGE__.&#39;::&#39;.$method_name} = $handler;
         ################

         return ($handler);
     }

     # This class can handle the method as part of a chain
     if (...) {
         my $chained_handler = sub {
             my $self = shift;
             ...
             return ...;
         };

         return ($chained_handler, &#39;:Chained&#39;);
     }

     # This class cannot handle the method request
     return;
 }</code></pre>

<p>Note: The <i>OPTIONAL</i> code above for installing the generated handler as a method should not be used with <code>:Cumulative</code> or <code>:Chained</code> automethods.</p>

<h1 id="OBJECT-SERIALIZATION"><a id="OBJECT1"></a>OBJECT SERIALIZATION</h1>

<h2 id="Basic-Serialization"><a id="Basic1"></a>Basic Serialization</h2>

<dl>

<dt id="my-$array_ref-=-$obj-&gt;dump();"><a id="my"></a><a id="my--array_ref----obj--dump"></a>my $array_ref = $obj-&gt;dump();</dt>
<dd>

</dd>
<dt id="my-$string-=-$obj-&gt;dump(1);"><a id="my1"></a><a id="my--string----obj--dump-1"></a>my $string = $obj-&gt;dump(1);</dt>
<dd>

<p>Object::InsideOut exports a method called <code>-&gt;dump()</code> to each class that returns either a <i>Perl</i> or a string representation of the object that invokes the method.</p>

<p>The <i>Perl</i> representation is returned when <code>-&gt;dump()</code> is called without arguments. It consists of an array ref whose first element is the name of the object&#39;s class, and whose second element is a hash ref containing the object&#39;s data. The object data hash ref contains keys for each of the classes that make up the object&#39;s hierarchy. The values for those keys are hash refs containing <span style="white-space: nowrap;"><code>key =&gt; value</code></span> pairs for the object&#39;s fields. For example:</p>

<pre><code> [
   &#39;My::Class::Sub&#39;,
   {
     &#39;My::Class&#39; =&gt; {
                      &#39;data&#39; =&gt; &#39;value&#39;
                    },
     &#39;My::Class::Sub&#39; =&gt; {
                           &#39;life&#39; =&gt; 42
                         }
   }
 ]</code></pre>

<p>The name for an object field (<i>data</i> and <i>life</i> in the example above) can be specified by adding the <code>:Name</code> attribute to the field:</p>

<pre><code> my @life :Field :Name(life);</code></pre>

<p>If the <code>:Name</code> attribute is not used, then the name for a field will be either the name associated with an <code>:All</code> or <code>:Arg</code> attribute, its <i>get</i> method name, its <i>set</i> method name, or, failing all that, a string of the form <code>ARRAY(0x...)</code> or <code>HASH(0x...)</code>.</p>

<p>When called with a <i>true</i> argument, <code>-&gt;dump()</code> returns a string version of the <i>Perl</i> representation using <a href="https://metacpan.org/pod/Data::Dumper">Data::Dumper</a>.</p>

<p>Note that using <a href="https://metacpan.org/pod/Data::Dumper">Data::Dumper</a> directly on an inside-out object will not produce the desired results (it&#39;ll just output the contents of the scalar ref). Also, if inside-out objects are stored inside other structures, a dump of those structures will not contain the contents of the object&#39;s fields.</p>

<p>In the event of a method naming conflict, the <code>-&gt;dump()</code> method can be called using its fully-qualified name:</p>

<pre><code> my $dump = $obj-&gt;Object::InsideOut::dump();</code></pre>

</dd>
<dt id="my-$obj-=-Object::InsideOut-&gt;pump($data);"><a id="my2"></a><a id="my--obj---Object::InsideOut--pump-data"></a>my $obj = Object::InsideOut-&gt;pump($data);</dt>
<dd>

<p><code>Object::InsideOut-&gt;pump()</code> takes the output from the <code>-&gt;dump()</code> method, and returns an object that is created using that data. If <code>$data</code> is the array ref returned by using <code>$obj-&gt;dump()</code>, then the data is inserted directly into the corresponding fields for each class in the object&#39;s class hierarchy. If <code>$data</code> is the string returned by using <code>$obj-&gt;dump(1)</code>, then it is <code>eval</code>ed to turn it into an array ref, and then processed as above.</p>

<p><b>Caveats</b>: If any of an object&#39;s fields are dumped to field name keys of the form <code>ARRAY(0x...)</code> or <code>HASH(0x...)</code> (see above), then the data will not be reloadable using <code>Object::InsideOut-&gt;pump()</code>. To overcome this problem, the class developer must either add <code>:Name</code> attributes to the <code>:Field</code> declarations (see above), or provide a <code>:Dumper</code>/<code>:Pumper</code> pair of subroutines as described below.</p>

<p>Dynamically altering a class (e.g., using <a href="./Object::InsideOut.html#DYNAMIC-FIELD-CREATION">-&gt;create_field()</a>) after objects have been dumped will result in <code>undef</code> fields when pumped back in regardless of whether or not the added fields have defaults.</p>

<p>Modifying the output from <code>-&gt;dump()</code>, and then feeding it into <code>Object::InsideOut-&gt;pump()</code> will work, but is not specifically supported. If you know what you&#39;re doing, fine, but you&#39;re on your own.</p>

</dd>
<dt id=":Dumper-Subroutine-Attribute"><a id="Dumper-Subroutine-Attribute"></a><code>:Dumper</code> Subroutine Attribute</dt>
<dd>

<p>If a class requires special processing to dump its data, then it can provide a subroutine labeled with the <code>:Dumper</code> attribute. This subroutine will be sent the object that is being dumped. It may then return any type of scalar the developer deems appropriate. Usually, this would be a hash ref containing <span style="white-space: nowrap;"><code>key =&gt; value</code></span> pairs for the object&#39;s fields. For example:</p>

<pre><code> my @data :Field;

 sub _dump :Dumper
 {
     my $obj = $_[0];

     my %field_data;
     $field_data{&#39;data&#39;} = $data[$$obj];

     return (\%field_data);
 }</code></pre>

<p>Just be sure not to call your <code>:Dumper</code> subroutine <code>dump</code> as that is the name of the dump method exported by Object::InsideOut as explained above.</p>

</dd>
<dt id=":Pumper-Subroutine-Attribute"><a id="Pumper-Subroutine-Attribute"></a><code>:Pumper</code> Subroutine Attribute</dt>
<dd>

<p>If a class supplies a <code>:Dumper</code> subroutine, it will most likely need to provide a complementary <code>:Pumper</code> labeled subroutine that will be used as part of creating an object from dumped data using <code>Object::InsideOut-&gt;pump()</code>. The subroutine will be supplied the new object that is being created, and whatever scalar was returned by the <code>:Dumper</code> subroutine. The corresponding <code>:Pumper</code> for the example <code>:Dumper</code> above would be:</p>

<pre><code> sub _pump :Pumper
 {
     my ($obj, $field_data) = @_;

     $obj-&gt;set(\@data, $field_data-&gt;{&#39;data&#39;});
 }</code></pre>

</dd>
</dl>

<h2 id="Storable">Storable</h2>

<p>Object::InsideOut also supports object serialization using the <a href="https://metacpan.org/pod/Storable">Storable</a> module. There are two methods for specifying that a class can be serialized using <a href="https://metacpan.org/pod/Storable">Storable</a>. The first method involves adding <a href="https://metacpan.org/pod/Storable">Storable</a> to the Object::InsideOut declaration in your package:</p>

<pre><code> package My::Class; {
     use Object::InsideOut qw(Storable);
     ...
 }</code></pre>

<p>and adding <span style="white-space: nowrap;"><code>use Storable;</code></span> in your application. Then you can use the <code>-&gt;store()</code> and <code>-&gt;freeze()</code> methods to serialize your objects, and the <code>retrieve()</code> and <code>thaw()</code> subroutines to de-serialize them.</p>

<pre><code> package main;
 use Storable;
 use My::Class;

 my $obj = My::Class-&gt;new(...);
 $obj-&gt;store(&#39;/tmp/object.dat&#39;);
 ...
 my $obj2 = retrieve(&#39;/tmp/object.dat&#39;);</code></pre>

<p>The other method of specifying <a href="https://metacpan.org/pod/Storable">Storable</a> serialization involves setting a <span style="white-space: nowrap;"><code>::storable</code></span> variable inside a <code>BEGIN</code> block for the class prior to its use:</p>

<pre><code> package main;
 use Storable;

 BEGIN {
     $My::Class::storable = 1;
 }
 use My::Class;</code></pre>

<p>NOTE: The <i>caveats</i> discussed above for the <code>-&gt;pump()</code> method are also applicable when using the Storable module.</p>

<h1 id="OBJECT-COERCION"><a id="OBJECT2"></a>OBJECT COERCION</h1>

<p>Object::InsideOut provides support for various forms of object coercion through the <a href="https://metacpan.org/pod/overload">overload</a> mechanism. For instance, if you want an object to be usable directly in a string, you would supply a subroutine in your class labeled with the <code>:Stringify</code> attribute:</p>

<pre><code> sub as_string :Stringify
 {
     my $self = $_[0];
     my $string = ...;
     return ($string);
 }</code></pre>

<p>Then you could do things like:</p>

<pre><code> print(&quot;The object says, &#39;$obj&#39;\n&quot;);</code></pre>

<p>For a boolean context, you would supply:</p>

<pre><code> sub as_bool :Boolify
 {
     my $self = $_[0];
     my $true_or_false = ...;
     return ($true_or_false);
 }</code></pre>

<p>and use it in this manner:</p>

<pre><code> if (! defined($obj)) {
     # The object is undefined
     ....

 } elsif (! $obj) {
     # The object returned a false value
     ...
 }</code></pre>

<p>The following coercion attributes are supported:</p>

<dl>

<dt id=":Stringify"><a id="Stringify"></a>:Stringify</dt>
<dd>

</dd>
<dt id=":Numerify"><a id="Numerify"></a>:Numerify</dt>
<dd>

</dd>
<dt id=":Boolify"><a id="Boolify"></a>:Boolify</dt>
<dd>

</dd>
<dt id=":Arrayify"><a id="Arrayify"></a>:Arrayify</dt>
<dd>

</dd>
<dt id=":Hashify"><a id="Hashify"></a>:Hashify</dt>
<dd>

</dd>
<dt id=":Globify"><a id="Globify"></a>:Globify</dt>
<dd>

</dd>
<dt id=":Codify"><a id="Codify"></a>:Codify</dt>
<dd>

</dd>
</dl>

<p>Coercing an object to a scalar (<code>:Scalarify</code>) is <b>not</b> supported as <code>$$obj</code> is the ID of the object and cannot be overridden.</p>

<h1 id="CLONING">CLONING</h1>

<h2 id="Object-Cloning"><a id="Object4"></a>Object Cloning</h2>

<p>Copies of objects can be created using the <code>-&gt;clone()</code> method which is exported by Object::InsideOut to each class:</p>

<pre><code> my $obj2 = $obj-&gt;clone();</code></pre>

<p>When called without arguments, <code>-&gt;clone()</code> creates a <i>shallow</i> copy of the object, meaning that any complex data structures (i.e., array, hash or scalar refs) stored in the object will be shared with its clone.</p>

<p>Calling <code>-&gt;clone()</code> with a <i>true</i> argument:</p>

<pre><code> my $obj2 = $obj-&gt;clone(1);</code></pre>

<p>creates a <i>deep</i> copy of the object such that internally held array, hash or scalar refs are <i>replicated</i> and stored in the newly created clone.</p>

<p><i>Deep</i> cloning can also be controlled at the field level, and is covered in the next section.</p>

<p>Note that cloning does not clone internally held objects. For example, if <code>$foo</code> contains a reference to <code>$bar</code>, a clone of <code>$foo</code> will also contain a reference to <code>$bar</code>; not a clone of <code>$bar</code>. If such behavior is needed, it must be provided using a <a href="./Object::InsideOut.html#Object-Replication">:Replicate</a> subroutine.</p>

<h2 id="Field-Cloning"><a id="Field3"></a>Field Cloning</h2>

<p>Object cloning can be controlled at the field level such that specified fields are <i>deeply</i> copied when <code>-&gt;clone()</code> is called without any arguments. This is done by adding the <code>:Deep</code> attribute to the field:</p>

<pre><code> my @data :Field :Deep;</code></pre>

<h1 id="WEAK-FIELDS"><a id="WEAK"></a>WEAK FIELDS</h1>

<p>Frequently, it is useful to store <a href="https://metacpan.org/pod/Scalar::Util#weaken-REF">weaken</a>ed references to data or objects in a field. Such a field can be declared as <code>:Weak</code> so that data (i.e., references) set via Object::InsideOut generated accessors, parameter processing using <code>:Arg</code>, the <code>-&gt;set()</code> method, etc., will automatically be <a href="https://metacpan.org/pod/Scalar::Util#weaken-REF">weaken</a>ed after being stored in the field array/hash.</p>

<pre><code> my @data :Field :Weak;</code></pre>

<p>NOTE: If data in a <i>weak</i> field is set directly (i.e., the <code>-&gt;set()</code> method is not used), then <a href="https://metacpan.org/pod/Scalar::Util#weaken-REF">weaken()</a> must be invoked on the stored reference afterwards:</p>

<pre><code> $self-&gt;set(\@field, $data);
 Scalar::Util::weaken($field[$$self]);</code></pre>

<p>(This is another reason why the <code>-&gt;set()</code> method is recommended for setting field data within class code.)</p>

<h1 id="DYNAMIC-FIELD-CREATION"><a id="DYNAMIC"></a>DYNAMIC FIELD CREATION</h1>

<p>Normally, object fields are declared as part of the class code. However, some classes may need the capability to create object fields <i>on-the-fly</i>, for example, as part of an <code>:Automethod</code>. Object::InsideOut provides a class method for this:</p>

<pre><code> # Dynamically create a hash field with standard accessors
 My::Class-&gt;create_field(&#39;%&#39;.$fld, &quot;:Std($fld)&quot;);</code></pre>

<p>The first argument is the class into which the field will be added. The second argument is a string containing the name of the field preceded by either a <code>@</code> or <code>%</code> to declare an array field or hash field, respectively. The remaining string arguments should be attributes declaring accessors and the like. The <code>:Field</code> attribute is assumed, and does not need to be added to the attribute list. For example:</p>

<pre><code> My::Class-&gt;create_field(&#39;@data&#39;, &quot;:Type(numeric)&quot;,
                                  &quot;:Acc(data)&quot;);

 My::Class-&gt;create_field(&#39;@obj&#39;, &quot;:Type(Some::Class)&quot;,
                                 &quot;:Acc(obj)&quot;,
                                 &quot;:Weak&quot;);</code></pre>

<p>Field creation will fail if you try to create an array field within a class whose hierarchy has been declared <a href="./Object::InsideOut.html#HASH-ONLY-CLASSES">:hash_only</a>.</p>

<p>Here&#39;s an example of an <code>:Automethod</code> subroutine that uses dynamic field creation:</p>

<pre><code> package My::Class; {
     use Object::InsideOut;

     sub _automethod :Automethod
     {
         my $self = $_[0];
         my $class = ref($self) || $self;
         my $method = $_;

         # Extract desired field name from get_/set_ method name
         my ($fld_name) = $method =~ /^[gs]et_(.*)$/;
         if (! $fld_name) {
             return;    # Not a recognized method
         }

         # Create the field and its standard accessors
         $class-&gt;create_field(&#39;@&#39;.$fld_name, &quot;:Std($fld_name)&quot;);

         # Return code ref for newly created accessor
         no strict &#39;refs&#39;;
         return *{$class.&#39;::&#39;.$method}{&#39;CODE&#39;};
     }
 }</code></pre>

<h1 id="RUNTIME-INHERITANCE"><a id="RUNTIME"></a>RUNTIME INHERITANCE</h1>

<p>The class method <code>-&gt;add_class()</code> provides the capability to dynamically add classes to a class hierarchy at runtime.</p>

<p>For example, suppose you had a simple <i>state</i> class:</p>

<pre><code> package Trait::State; {
     use Object::InsideOut;

     my %state :Field :Set(state);
 }</code></pre>

<p>This could be added to another class at runtime using:</p>

<pre><code> My::Class-&gt;add_class(&#39;Trait::State&#39;);</code></pre>

<p>This permits, for example, application code to dynamically modify a class without having it create an actual sub-class.</p>

<h1 id="PREPROCESSING">PREPROCESSING</h1>

<h2 id="Parameter-Preprocessing"><a id="Parameter1"></a>Parameter Preprocessing</h2>

<p>You can specify a code ref (either in the form of an anonymous subroutine, or a subroutine name) for an object initialization parameter that will be called on that parameter prior to taking any of the other parameter actions described above. Here&#39;s an example:</p>

<pre><code> package My::Class; {
     use Object::InsideOut;

     # The parameter preprocessing subroutine
     sub preproc
     {
         my ($class, $param, $spec, $obj, $value) = @_;

         # Preform parameter preprocessing
         ...

         # Return result
         return ...;
     }

     my @data :Field
              :Arg(&#39;Name&#39; =&gt; &#39;DATA&#39;, &#39;Preprocess&#39; =&gt; \&amp;My::Class::preproc);

     my %init_args :InitArgs = (
         &#39;PARAM&#39; =&gt; {
             &#39;Preprocess&#39; =&gt; \&amp;preproc,
         },
     );

     ...
 }</code></pre>

<p>When used in the <code>:Arg</code> attribute, the subroutine name must be fully-qualified, as illustrated. Further, if not referenced in the <code>:InitArgs</code> hash, the preprocessing subroutine can be given the <code>:Private</code> attribute.</p>

<p>As the above illustrates, the parameter preprocessing subroutine is sent five arguments:</p>

<ul>

<li><p>The name of the class associated with the parameter</p>

<p>This would be <code>My::Class</code> in the example above.</p>

</li>
<li><p>The name of the parameter</p>

<p>Either <code>DATA</code> or <code>PARAM</code> in the example above.</p>

</li>
<li><p>A hash ref of the parameter&#39;s specifiers</p>

<p>This is either a hash ref containing the <code>:Arg</code> attribute parameters, or the hash ref paired to the parameter&#39;s key in the <code>:InitArgs</code> hash.</p>

</li>
<li><p>The object being initialized</p>

</li>
<li><p>The parameter&#39;s value</p>

<p>This is the value assigned to the parameter in the <code>-&gt;new()</code> method&#39;s argument list. If the parameter was not provided to <code>-&gt;new()</code>, then <code>undef</code> will be sent.</p>

</li>
</ul>

<p>The return value of the preprocessing subroutine will then be assigned to the parameter.</p>

<p>Be careful about what types of data the preprocessing subroutine tries to make use of <code>external</code> to the arguments supplied. For instance, because the order of parameter processing is not specified, the preprocessing subroutine cannot rely on whether or not some other parameter is set. Such processing would need to be done in the <code>:Init</code> subroutine. It can, however, make use of object data set by classes <i>higher up</i> in the class hierarchy. (That is why the object is provided as one of the arguments.)</p>

<p>Possible uses for parameter preprocessing include:</p>

<ul>

<li><p>Overriding the supplied value (or even deleting it by returning <code>undef</code>)</p>

</li>
<li><p>Providing a dynamically-determined default value</p>

</li>
</ul>

<p><i>Preprocess</i> may be abbreviated to <i>Preproc</i> or <i>Pre</i>.</p>

<h2 id="Set-Accessor-Preprocessing"><a id="Set1"></a><i>Set</i> Accessor Preprocessing</h2>

<p>You can specify a code ref (either in the form of an anonymous subroutine, or a fully-qualified subroutine name) for a <i>set/combined</i> accessor that will be called on the arguments supplied to the accessor prior to its taking the usual actions of type checking and adding the data to the field. Here&#39;s an example:</p>

<pre><code> package My::Class; {
     use Object::InsideOut;

     my @data :Field
              :Acc(&#39;Name&#39; =&gt; &#39;data&#39;, &#39;Preprocess&#39; =&gt; \&amp;My::Class::preproc);

     # The set accessor preprocessing subroutine may be made &#39;Private&#39;
     sub preproc :Private
     {
         my ($self, $field, @args) = @_;

         # Preform preprocessing on the accessor&#39;s arguments
         ...

         # Return result
         return ...;
     }
 }</code></pre>

<p>As the above illustrates, the accessor preprocessing subroutine is sent the following arguments:</p>

<ul>

<li><p>The object used to invoke the accessor</p>

</li>
<li><p>A reference to the field associated with the accessor</p>

</li>
<li><p>The argument(s) sent to the accessor</p>

<p>There will always be at least one argument.</p>

</li>
</ul>

<p>Usually, the preprocessing subroutine would return just a single value. For fields declared as type <code>List</code>, multiple values may be returned.</p>

<p>Following preprocessing, the <i>set</i> accessor will operate on whatever value(s) are returned by the preprocessing subroutine.</p>

<h1 id="SPECIAL-PROCESSING"><a id="SPECIAL"></a>SPECIAL PROCESSING</h1>

<h2 id="Object-ID"><a id="Object5"></a>Object ID</h2>

<p>By default, the ID of an object is derived from a sequence counter for the object&#39;s class hierarchy. This should suffice for nearly all cases of class development. If there is a special need for the module code to control the object ID (see <a href="https://metacpan.org/pod/Math::Random::MT::Auto">Math::Random::MT::Auto</a> as an example), then a subroutine labelled with the <code>:ID</code> attribute can be specified:</p>

<pre><code> sub _id :ID
 {
     my $class = $_[0];

     # Generate/determine a unique object ID
     ...

     return ($id);
 }</code></pre>

<p>The ID returned by your subroutine can be any kind of <i>regular</i> scalar (e.g., a string or a number). However, if the ID is something other than a low-valued integer, then you will have to architect <b>all</b> your classes using hashes for the object fields. See <a href="./Object::InsideOut.html#HASH-ONLY-CLASSES">&quot;HASH ONLY CLASSES&quot;</a> for details.</p>

<p>Within any class hierarchy, only one class may specify an <code>:ID</code> subroutine.</p>

<h2 id="Object-Replication"><a id="Object6"></a>Object Replication</h2>

<p>Object replication occurs explicitly when the <code>-&gt;clone()</code> method is called on an object, and implicitly when threads are created in a threaded application. In nearly all cases, Object::InsideOut will take care of all the details for you.</p>

<p>In rare cases, a class may require special handling for object replication. It must then provide a subroutine labeled with the <code>:Replicate</code> attribute. This subroutine will be sent three arguments: The parent and the cloned objects, and a flag:</p>

<pre><code> sub _replicate :Replicate
 {
     my ($parent, $clone, $flag) = @_;

     # Special object replication processing
     if ($clone eq &#39;CLONE&#39;) {
        # Handling for thread cloning
        ...
     } elsif ($clone eq &#39;deep&#39;) {
        # Deep copy of the parent
        ...
     } else {
        # Shallow copying
        ...
     }
 }</code></pre>

<p>In the case of thread cloning, <code>$flag</code> will be set to the <code>&#39;CLONE&#39;</code>, and the <code>$parent</code> object is just a non-blessed anonymous scalar reference that contains the ID for the object in the parent thread.</p>

<p>When invoked via the <code>-&gt;clone()</code> method, <code>$flag</code> will be either an empty string which denotes that a <i>shallow</i> copy is being produced for the clone, or <code>$flag</code> will be set to <code>&#39;deep&#39;</code> indicating a <i>deep</i> copy is being produced.</p>

<p>The <code>:Replicate</code> subroutine only needs to deal with the special replication processing needed by the object: Object::InsideOut will handle all the other details.</p>

<h2 id="Object-Destruction"><a id="Object7"></a>Object Destruction</h2>

<p>Object::InsideOut exports a <code>DESTROY</code> method to each class that deletes an object&#39;s data from the object field arrays (hashes). If a class requires additional destruction processing (e.g., closing filehandles), then it must provide a subroutine labeled with the <code>:Destroy</code> attribute. This subroutine will be sent the object that is being destroyed:</p>

<pre><code> sub _destroy :Destroy
 {
     my $obj = $_[0];

     # Special object destruction processing
 }</code></pre>

<p>The <code>:Destroy</code> subroutine only needs to deal with the special destruction processing: The <code>DESTROY</code> method will handle all the other details of object destruction.</p>

<h1 id="FOREIGN-CLASS-INHERITANCE"><a id="FOREIGN"></a>FOREIGN CLASS INHERITANCE</h1>

<p>Object::InsideOut supports inheritance from foreign (i.e., non-Object::InsideOut) classes. This means that your classes can inherit from other Perl class, and access their methods from your own objects.</p>

<p>One method of declaring foreign class inheritance is to add the class name to the Object::InsideOut declaration inside your package:</p>

<pre><code> package My::Class; {
     use Object::InsideOut qw(Foreign::Class);
     ...
 }</code></pre>

<p>This allows you to access the foreign class&#39;s static (i.e., class) methods from your own class. For example, suppose <code>Foreign::Class</code> has a class method called <code>foo</code>. With the above, you can access that method using <code>My::Class-&gt;foo()</code> instead.</p>

<p>Multiple foreign inheritance is supported, as well:</p>

<pre><code> package My::Class; {
     use Object::InsideOut qw(Foreign::Class Other::Foreign::Class);
     ...
 }</code></pre>

<dl>

<dt id="$self-&gt;inherit($obj,-...);"><a id="self--inherit-obj"></a>$self-&gt;inherit($obj, ...);</dt>
<dd>

<p>To use object methods from foreign classes, an object must <i>inherit</i> from an object of that class. This would normally be done inside a class&#39;s <code>:Init</code> subroutine:</p>

<pre><code> package My::Class; {
     use Object::InsideOut qw(Foreign::Class);

     sub init :Init
     {
         my ($self, $args) = @_;

         my $foreign_obj = Foreign::Class-&gt;new(...);
         $self-&gt;inherit($foreign_obj);
     }
 }</code></pre>

<p>Thus, with the above, if <code>Foreign::Class</code> has an object method called <code>bar</code>, you can call that method from your own objects:</p>

<pre><code> package main;

 my $obj = My::Class-&gt;new();
 $obj-&gt;bar();</code></pre>

<p>Object::InsideOut&#39;s <code>AUTOLOAD</code> subroutine handles the dispatching of the <code>-&gt;bar()</code> method call using the internally held inherited object (in this case, <code>$foreign_obj</code>).</p>

<p>Multiple inheritance is supported, as well: You can call the <code>-&gt;inherit()</code> method multiple times, or make just one call with all the objects to be inherited from.</p>

<p><code>-&gt;inherit()</code> is a restricted method. In other words, you cannot use it on an object outside of code belonging to the object&#39;s class tree (e.g., you can&#39;t call it from application code).</p>

<p>In the event of a method naming conflict, the <code>-&gt;inherit()</code> method can be called using its fully-qualified name:</p>

<pre><code> $self-&gt;Object::InsideOut::inherit($obj);</code></pre>

</dd>
<dt id="my-@objs-=-$self-&gt;heritage();"><a id="my3"></a><a id="my--objs----self--heritage"></a>my @objs = $self-&gt;heritage();</dt>
<dd>

</dd>
<dt id="my-$obj-=-$self-&gt;heritage($class);"><a id="my4"></a><a id="my--obj----self--heritage-class"></a>my $obj = $self-&gt;heritage($class);</dt>
<dd>

</dd>
<dt id="my-@objs-=-$self-&gt;heritage($class1,-$class2,-...);"><a id="my5"></a><a id="my--objs----self--heritage-class1---class2"></a>my @objs = $self-&gt;heritage($class1, $class2, ...);</dt>
<dd>

<p>Your class code can retrieve any inherited objects using the <code>-&gt;heritage()</code> method. When called without any arguments, it returns a list of any objects that were stored by the calling class using the calling object. In other words, if class <code>My::Class</code> uses object <code>$obj</code> to store foreign objects <code>$fobj1</code> and <code>$fobj2</code>, then later on in class <code>My::Class</code>, <code>$obj-&gt;heritage()</code> will return <code>$fobj1</code> and <code>$fobj2</code>.</p>

<p><code>-&gt;heritage()</code> can also be called with one or more class name arguments. In this case, only objects of the specified class(es) are returned.</p>

<p>In the event of a method naming conflict, the <code>-&gt;heritage()</code> method can be called using its fully-qualified name:</p>

<pre><code> my @objs = $self-&gt;Object::InsideOut::heritage();</code></pre>

</dd>
<dt id="$self-&gt;disinherit($class-[,-...])"><a id="self--disinherit-class"></a>$self-&gt;disinherit($class [, ...])</dt>
<dd>

</dd>
<dt id="$self-&gt;disinherit($obj-[,-...])"><a id="self--disinherit-obj"></a>$self-&gt;disinherit($obj [, ...])</dt>
<dd>

<p>The <code>-&gt;disinherit()</code> method disassociates (i.e., deletes) the inheritance of foreign object(s) from an object. The foreign objects may be specified by class, or using the actual inherited object (retrieved via <code>-&gt;heritage()</code>, for example).</p>

<p>The call is only effective when called inside the class code that established the initial inheritance. In other words, if an inheritance is set up inside a class, then disinheritance can only be done from inside that class.</p>

<p>In the event of a method naming conflict, the <code>-&gt;disinherit()</code> method can be called using its fully-qualified name:</p>

<pre><code> $self-&gt;Object::InsideOut::disinherit($obj [, ...])</code></pre>

</dd>
</dl>

<p><b>NOTE</b>: With foreign inheritance, you only have access to class and object methods. The encapsulation of the inherited objects is strong, meaning that only the class where the inheritance takes place has direct access to the inherited object. If access to the inherited objects themselves, or their internal hash fields (in the case of <i>blessed hash</i> objects), is needed outside the class, then you&#39;ll need to write your own accessors for that.</p>

<p><b>LIMITATION</b>: You cannot use fully-qualified method names to access foreign methods (when encapsulated foreign objects are involved). Thus, the following will not work:</p>

<pre><code> my $obj = My::Class-&gt;new();
 $obj-&gt;Foreign::Class::bar();</code></pre>

<p>Normally, you shouldn&#39;t ever need to do the above: <code>$obj-&gt;bar()</code> would suffice.</p>

<p>The only time this may be an issue is when the <i>native</i> class <i>overrides</i> an inherited foreign class&#39;s method (e.g., <code>My::Class</code> has its own <code>-&gt;bar()</code> method). Such overridden methods are not directly callable. If such overriding is intentional, then this should not be an issue: No one should be writing code that tries to by-pass the override. However, if the overriding is accidentally, then either the <i>native</i> method should be renamed, or the <i>native</i> class should provide a wrapper method so that the functionality of the overridden method is made available under a different name.</p>

<h2 id="use-base-and-Fully-qualified-Method-Names"><a id="use"></a><code>use base</code> and Fully-qualified Method Names</h2>

<p>The foreign inheritance methodology handled by the above is predicated on non-Object::InsideOut classes that generate their own objects and expect their object methods to be invoked via those objects.</p>

<p>There are exceptions to this rule:</p>

<dl>

<dt id="1.-Foreign-object-methods-that-expect-to-be-invoked-via-the-inheriting-class&#39;s-object,-or-foreign-object-methods-that-don&#39;t-care-how-they-are-invoked-(i.e.,-they-don&#39;t-make-reference-to-the-invoking-object)."><a id="11"></a><a id="Foreign-object-methods-that-expect-to-be-invoked-via-the-inheriting-class-s-object--or-foreign-object-methods-that-don-t-care-how-they-are-invoked--i.e.--they-don-t-make-reference-to-the-invoking-object"></a>1. Foreign object methods that expect to be invoked via the inheriting class&#39;s object, or foreign object methods that don&#39;t care how they are invoked (i.e., they don&#39;t make reference to the invoking object).</dt>
<dd>

<p>This is the case where a class provides auxiliary methods for your objects, but from which you don&#39;t actually create any objects (i.e., there is no corresponding foreign object, and <code>$obj-&gt;inherit($foreign)</code> is not used.)</p>

<p>In this case, you can either:</p>

<p>a. Declare the foreign class using the standard method (i.e., <span style="white-space: nowrap;"><code>use Object::InsideOut qw(Foreign::Class);</code></span>), and invoke its methods using their full path (e.g., <code>$obj-&gt;Foreign::Class::method();</code>); or</p>

<p>b. You can use the <a href="https://metacpan.org/pod/base">base</a> pragma so that you don&#39;t have to use the full path for foreign methods.</p>

<pre><code> package My::Class; {
     use Object::InsideOut;
     use base &#39;Foreign::Class&#39;;
     ...
 }</code></pre>

<p>The former scheme is faster.</p>

</dd>
<dt id="2.-Foreign-class-methods-that-expect-to-be-invoked-via-the-inheriting-class."><a id="21"></a><a id="Foreign-class-methods-that-expect-to-be-invoked-via-the-inheriting-class"></a>2. Foreign class methods that expect to be invoked via the inheriting class.</dt>
<dd>

<p>As with the above, you can either invoke the class methods using their full path (e.g., <code>My::Class-&gt;Foreign::Class::method();</code>), or you can <span style="white-space: nowrap;"><code>use base</code></span> so that you don&#39;t have to use the full path. Again, using the full path is faster.</p>

<p><a href="https://metacpan.org/pod/Class::Singleton">Class::Singleton</a> is an example of this type of class.</p>

</dd>
<dt id="3.-Class-methods-that-don&#39;t-care-how-they-are-invoked-(i.e.,-they-don&#39;t-make-reference-to-the-invoking-class)."><a id="31"></a><a id="Class-methods-that-don-t-care-how-they-are-invoked--i.e.--they-don-t-make-reference-to-the-invoking-class"></a>3. Class methods that don&#39;t care how they are invoked (i.e., they don&#39;t make reference to the invoking class).</dt>
<dd>

<p>In this case, you can either use <span style="white-space: nowrap;"><code>use Object::InsideOut qw(Foreign::Class);</code></span> for consistency, or use <span style="white-space: nowrap;"><code>use base qw(Foreign::Class);</code></span> if (slightly) better performance is needed.</p>

</dd>
</dl>

<p>If you&#39;re not familiar with the inner workings of the foreign class such that you don&#39;t know if or which of the above exceptions applies, then the formulaic approach would be to first use the documented method for foreign inheritance (i.e., <span style="white-space: nowrap;"><code>use Object::InsideOut qw(Foreign::Class);</code></span>). If that works, then I strongly recommend that you just use that approach unless you have a good reason not to. If it doesn&#39;t work, then try <span style="white-space: nowrap;"><code>use base</code></span>.</p>

<h1 id="INTROSPECTION">INTROSPECTION</h1>

<p>For Perl 5.8.0 and later, Object::InsideOut provides an introspection API that allow you to obtain metadata on a class&#39;s hierarchy, constructor parameters, and methods.</p>

<dl>

<dt id="my-$meta-=-My::Class-&gt;meta();"><a id="my6"></a><a id="my--meta---My::Class--meta"></a>my $meta = My::Class-&gt;meta();</dt>
<dd>

</dd>
<dt id="my-$meta-=-$obj-&gt;meta();"><a id="my7"></a><a id="my--meta----obj--meta"></a>my $meta = $obj-&gt;meta();</dt>
<dd>

<p>The <code>-&gt;meta()</code> method, which is exported by Object::InsideOut to each class, returns an <a href="https://metacpan.org/pod/Object::InsideOut::Metadata">Object::InsideOut::Metadata</a> object which can then be <i>queried</i> for information about the invoking class or invoking object&#39;s class:</p>

<pre><code> # Get an object&#39;s class hierarchy
 my @classes = $obj-&gt;meta()-&gt;get_classes();

 # Get info on the args for a class&#39;s constructor (i.e., -&gt;new() parameters)
 my %args = My::Class-&gt;meta()-&gt;get_args();

 # Get info on the methods that can be called by an object
 my %methods = $obj-&gt;meta()-&gt;get_methods();</code></pre>

</dd>
<dt id="My::Class-&gt;isa();"><a id="My"></a><a id="My::Class--isa"></a>My::Class-&gt;isa();</dt>
<dd>

</dd>
<dt id="$obj-&gt;isa();"><a id="obj--isa"></a>$obj-&gt;isa();</dt>
<dd>

<p>When called in an array context, calling <code>-&gt;isa()</code> without any arguments on an Object::InsideOut class or object returns a list of the classes in the class hierarchy for that class or object, and is equivalent to:</p>

<pre><code> my @classes = $obj-&gt;meta()-&gt;get_classes();</code></pre>

<p>When called in a scalar context, it returns an array ref containing the classes.</p>

</dd>
<dt id="My::Class-&gt;can();"><a id="My1"></a><a id="My::Class--can"></a>My::Class-&gt;can();</dt>
<dd>

</dd>
<dt id="$obj-&gt;can();"><a id="obj--can"></a>$obj-&gt;can();</dt>
<dd>

<p>When called in an array context, calling <code>-&gt;can()</code> without any arguments on an Object::InsideOut class or object returns a list of the method names for that class or object, and is equivalent to:</p>

<pre><code> my %methods = $obj-&gt;meta()-&gt;get_methods();
 my @methods = keys(%methods);</code></pre>

<p>When called in a scalar context, it returns an array ref containing the method names.</p>

</dd>
</dl>

<p>See <a href="https://metacpan.org/pod/Object::InsideOut::Metadata">Object::InsideOut::Metadata</a> for more details.</p>

<h1 id="THREAD-SUPPORT"><a id="THREAD"></a>THREAD SUPPORT</h1>

<p>For Perl 5.8.1 and later, Object::InsideOut fully supports <a href="https://metacpan.org/pod/threads">threads</a> (i.e., is thread safe), and supports the sharing of Object::InsideOut objects between threads using <a href="https://metacpan.org/pod/threads::shared">threads::shared</a>.</p>

<p>To use Object::InsideOut in a threaded application, you must put <span style="white-space: nowrap;"><code>use threads;</code></span> at the beginning of the application. (The use of <span style="white-space: nowrap;"><code>require threads;</code></span> after the program is running is not supported.) If object sharing is to be utilized, then <span style="white-space: nowrap;"><code>use threads::shared;</code></span> should follow.</p>

<p>If you just <span style="white-space: nowrap;"><code>use threads;</code></span>, then objects from one thread will be copied and made available in a child thread.</p>

<p>The addition of <span style="white-space: nowrap;"><code>use threads::shared;</code></span> in and of itself does not alter the behavior of Object::InsideOut objects. The default behavior is to <i>not</i> share objects between threads (i.e., they act the same as with <span style="white-space: nowrap;"><code>use threads;</code></span> alone).</p>

<p>To enable the sharing of objects between threads, you must specify which classes will be involved with thread object sharing. There are two methods for doing this. The first involves setting a <code>::shared</code> variable (inside a <code>BEGIN</code> block) for the class prior to its use:</p>

<pre><code> use threads;
 use threads::shared;

 BEGIN {
     $My::Class::shared = 1;
 }
 use My::Class;</code></pre>

<p>The other method is for a class to add a <code>:SHARED</code> flag to its <span style="white-space: nowrap;"><code>use Object::InsideOut ...</code></span> declaration:</p>

<pre><code> package My::Class; {
     use Object::InsideOut &#39;:SHARED&#39;;
     ...
 }</code></pre>

<p>When either sharing flag is set for one class in an object hierarchy, then all the classes in the hierarchy are affected.</p>

<p>If a class cannot support thread object sharing (e.g., one of the object fields contains code refs [which Perl cannot share between threads]), it should specifically declare this fact:</p>

<pre><code> package My::Class; {
     use Object::InsideOut &#39;:NOT_SHARED&#39;;
     ...
 }</code></pre>

<p>However, you cannot mix thread object sharing classes with non-sharing classes in the same class hierarchy:</p>

<pre><code> use threads;
 use threads::shared;

 package My::Class; {
     use Object::InsideOut &#39;:SHARED&#39;;
     ...
 }

 package Other::Class; {
     use Object::InsideOut &#39;:NOT_SHARED&#39;;
     ...
 }

 package My::Derived; {
     use Object::InsideOut qw(My::Class Other::Class);   # ERROR!
     ...
 }</code></pre>

<p>Here is a complete example with thread object sharing enabled:</p>

<pre><code> use threads;
 use threads::shared;

 package My::Class; {
     use Object::InsideOut &#39;:SHARED&#39;;

     # One list-type field
     my @data :Field :Type(list) :Acc(data);
 }

 package main;

 # New object
 my $obj = My::Class-&gt;new();

 # Set the object&#39;s &#39;data&#39; field
 $obj-&gt;data(qw(foo bar baz));

 # Print out the object&#39;s data
 print(join(&#39;, &#39;, @{$obj-&gt;data()}), &quot;\n&quot;);       # &quot;foo, bar, baz&quot;

 # Create a thread and manipulate the object&#39;s data
 my $rc = threads-&gt;create(
         sub {
             # Read the object&#39;s data
             my $data = $obj-&gt;data();
             # Print out the object&#39;s data
             print(join(&#39;, &#39;, @{$data}), &quot;\n&quot;);  # &quot;foo, bar, baz&quot;
             # Change the object&#39;s data
             $obj-&gt;data(@$data[1..2], &#39;zooks&#39;);
             # Print out the object&#39;s modified data
             print(join(&#39;, &#39;, @{$obj-&gt;data()}), &quot;\n&quot;);  # &quot;bar, baz, zooks&quot;
             return (1);
         }
     )-&gt;join();

 # Show that changes in the object are visible in the parent thread
 # I.e., this shows that the object was indeed shared between threads
 print(join(&#39;, &#39;, @{$obj-&gt;data()}), &quot;\n&quot;);       # &quot;bar, baz, zooks&quot;</code></pre>

<h1 id="HASH-ONLY-CLASSES"><a id="HASH1"></a>HASH ONLY CLASSES</h1>

<p>For performance considerations, it is recommended that arrays be used for class fields whenever possible. The only time when hash-bases fields are required is when a class must provide its own <a href="./Object::InsideOut.html#Object-ID">object ID</a>, and those IDs are something other than low-valued integers. In this case, hashes must be used for fields not only in the class that defines the object ID subroutine, but also in every class in any class hierarchy that include such a class.</p>

<p>The <i>hash only</i> requirement can be enforced by adding the <code>:HASH_ONLY</code> flag to a class&#39;s <span style="white-space: nowrap;"><code>use Object::InsideOut ...</code></span> declaration:</p>

<pre><code> package My::Class; {
     use Object::InsideOut &#39;:hash_only&#39;;

     ...
 }</code></pre>

<p>This will cause Object::Inside to check every class in any class hierarchy that includes such flagged classes to make sure their fields are hashes and not arrays. It will also fail any <a href="./Object::InsideOut.html#DYNAMIC-FIELD-CREATION">-&gt;create_field()</a> call that tries to create an array-based field in any such class.</p>

<h1 id="SECURITY">SECURITY</h1>

<p>In the default case where Object::InsideOut provides object IDs that are sequential integers, it is possible to hack together a <i>fake</i> Object::InsideOut object, and so gain access to another object&#39;s data:</p>

<pre><code> my $fake = bless(\do{my $scalar}, &#39;Some::Class&#39;);
 $$fake = 86;   # ID of another object
 my $stolen = $fake-&gt;get_data();</code></pre>

<p>Why anyone would try to do this is unknown. How this could be used for any sort of malicious exploitation is also unknown. However, if preventing this sort of security issue is a requirement, it can be accomplished by adding the <code>:SECURE</code> flag to a class&#39;s <span style="white-space: nowrap;"><code>use Object::InsideOut ...</code></span> declaration:</p>

<pre><code> package My::Class; {
     use Object::InsideOut &#39;:SECURE&#39;;

     ...
 }</code></pre>

<p>This places the module <code>Object::InsideOut::Secure</code> in the class hierarchy. Object::InsideOut::Secure provides an <a href="./Object::InsideOut.html#Object-ID">:ID subroutine</a> that generates random integers for object IDs, thus preventing other code from being able to create fake objects by <i>guessing</i> at IDs.</p>

<p>Using <code>:SECURE</code> mode requires <a href="https://metacpan.org/pod/Math::Random::MT::Auto">Math::Random::MT::Auto</a> (v5.04 or later).</p>

<p>Because the object IDs used with <code>:SECURE</code> mode are large random values, the <a href="./Object::InsideOut.html#HASH-ONLY-CLASSES">:HASH_ONLY</a> flag is forced on all the classes in the hierarchy.</p>

<p>For efficiency, it is recommended that the <code>:SECURE</code> flag be added to the topmost class(es) in a hierarchy.</p>

<h1 id="ATTRIBUTE-HANDLERS"><a id="ATTRIBUTE"></a>ATTRIBUTE HANDLERS</h1>

<p>Object::InsideOut uses <i>attribute &#39;modify&#39; handlers</i> as described in <a href="https://metacpan.org/pod/attributes#Package-specific-Attribute-Handling">&quot;Package-specific Attribute Handling&quot; in attributes</a>, and provides a mechanism for adding attribute handlers to your own classes. Instead of naming your attribute handler as <code>MODIFY_*_ATTRIBUTES</code>, name it something else and then label it with the <code>:MODIFY_*_ATTRIBUTES</code> attribute (or <code>:MOD_*_ATTRS</code> for short). Your handler should work just as described in <a href="https://metacpan.org/pod/attributes#Package-specific-Attribute-Handling">&quot;Package-specific Attribute Handling&quot; in attributes</a> with regard to its input arguments, and must return a list of the attributes which were not recognized by your handler. Here&#39;s an example:</p>

<pre><code> package My::Class; {
     use Object::InsideOut;

     sub _scalar_attrs :MOD_SCALAR_ATTRS
     {
         my ($pkg, $scalar, @attrs) = @_;
         my @unused_attrs;         # List of any unhandled attributes

         while (my $attr = shift(@attrs)) {
             if ($attr =~ /.../) {
                 # Handle attribute
                 ...
             } else {
                 # We don&#39;t handle this attribute
                 push(@unused_attrs, $attr);
             }
         }

         return (@unused_attrs);   # Pass along unhandled attributes
     }
 }</code></pre>

<p>Attribute &#39;modify&#39; handlers are called <i>upward</i> through the class hierarchy (i.e., <i>bottom up</i>). This provides child classes with the capability to <i>override</i> the handling of attributes by parent classes, or to add attributes (via the returned list of unhandled attributes) for parent classes to process.</p>

<p>Attribute &#39;modify&#39; handlers should be located at the beginning of a package, or at least before any use of attributes on the corresponding type of variable or subroutine:</p>

<pre><code> package My::Class; {
     use Object::InsideOut;

     sub _array_attrs :MOD_ARRAY_ATTRS
     {
        ...
     }

     my @my_array :MyArrayAttr;
 }</code></pre>

<p>For <i>attribute &#39;fetch&#39; handlers</i>, follow the same procedures: Label the subroutine with the <code>:FETCH_*_ATTRIBUTES</code> attribute (or <code>:FETCH_*_ATTRS</code> for short). Contrary to the documentation in <a href="https://metacpan.org/pod/attributes#Package-specific-Attribute-Handling">&quot;Package-specific Attribute Handling&quot; in attributes</a>, <i>attribute &#39;fetch&#39; handlers</i> receive <b>two</b> arguments: The relevant package name, and a reference to a variable or subroutine for which package-defined attributes are desired.</p>

<p>Attribute handlers are normal rendered <a href="./Object::InsideOut.html#Hidden-Methods">hidden</a>.</p>

<h1 id="SPECIAL-USAGE"><a id="SPECIAL1"></a>SPECIAL USAGE</h1>

<h2 id="Usage-With-Exporter"><a id="Usage"></a>Usage With <code>Exporter</code></h2>

<p>It is possible to use <a href="https://metacpan.org/pod/Exporter">Exporter</a> to export functions from one inside-out object class to another:</p>

<pre><code> use strict;
 use warnings;

 package Foo; {
     use Object::InsideOut &#39;Exporter&#39;;
     BEGIN {
         our @EXPORT_OK = qw(foo_name);
     }

     sub foo_name
     {
         return (__PACKAGE__);
     }
 }

 package Bar; {
     use Object::InsideOut &#39;Foo&#39; =&gt; [ qw(foo_name) ];

     sub get_foo_name
     {
         return (foo_name());
     }
 }

 package main;

 print(&quot;Bar got Foo&#39;s name as &#39;&quot;, Bar::get_foo_name(), &quot;&#39;\n&quot;);</code></pre>

<p>Note that the <code>BEGIN</code> block is needed to ensure that the <a href="https://metacpan.org/pod/Exporter">Exporter</a> symbol arrays (in this case <code>@EXPORT_OK</code>) get populated properly.</p>

<h2 id="Usage-With-require-and-mod_perl"><a id="Usage1"></a>Usage With <code>require</code> and <code>mod_perl</code></h2>

<p>Object::InsideOut usage under <a href="https://metacpan.org/pod/mod_perl">mod_perl</a> and with runtime-loaded classes is supported automatically; no special coding is required.</p>

<p><b>Caveat</b>: Runtime loading of classes should be performed before any objects are created within any of the classes in their hierarchies. If Object::InsideOut cannot create a hierarchy because of previously created objects (even if all those objects have been destroyed), a runtime error will be generated.</p>

<h2 id="Singleton-Classes"><a id="Singleton"></a>Singleton Classes</h2>

<p>A singleton class is a case where you would provide your own <code>-&gt;new()</code> method that in turn calls Object::InsideOut&#39;s <code>-&gt;new()</code> method:</p>

<pre><code> package My::Class; {
     use Object::InsideOut;

     my $singleton;

     sub new {
         my $thing = shift;
         if (! $singleton) {
             $singleton = $thing-&gt;Object::InsideOut::new(@_);
         }
         return ($singleton);
     }
 }</code></pre>

<h1 id="DIAGNOSTICS">DIAGNOSTICS</h1>

<p>Object::InsideOut uses <code>Exception::Class</code> for reporting errors. The base error class for this module is <code>OIO</code>. Here is an example of the basic manner for trapping and handling errors:</p>

<pre><code> my $obj;
 eval { $obj = My::Class-&gt;new(); };
 if (my $e = OIO-&gt;caught()) {
     warn(&#39;Failure creating object: &#39;.$e);
     ...
 }</code></pre>

<p>A more comprehensive approach might employ elements of the following:</p>

<pre><code> eval { ... };
 if (my $e = OIO-&gt;caught()) {
     # An error generated by Object::InsideOut
     ...
 } elsif (my $e = Exception::Class::Base-&gt;caught()) {
     # An error generated by other code that uses Exception::Class
     ...
 } elsif ($@) {
     # An unhandled error (i.e., generated by code that doesn&#39;t use
     # Exception::Class)
     ...
 }</code></pre>

<p>I have tried to make the messages and information returned by the error objects as informative as possible. Suggested improvements are welcome. Also, please bring to my attention any conditions that you encounter where an error occurs as a result of Object::InsideOut code that doesn&#39;t generate an Exception::Class object. Here is one such error:</p>

<dl>

<dt id="Invalid-ARRAY/HASH-attribute"><a id="Invalid"></a><a id="Invalid-ARRAY-HASH-attribute"></a>Invalid ARRAY/HASH attribute</dt>
<dd>

<p>This error indicates you forgot <code>use Object::InsideOut;</code> in your class&#39;s code.</p>

</dd>
</dl>

<p>Object::InsideOut installs a <code>__DIE__</code> handler (see <a href="functions/CORE.html#die-LIST">&quot;die LIST&quot; in perlfunc</a> and <a href="functions/CORE.html#eval-BLOCK">&quot;eval BLOCK&quot; in perlfunc</a>) to catch any errant exceptions from class-specific code, namely, <code>:Init</code>, <code>:Replicate</code>, <code>:Destroy</code>, etc. subroutines. When using <code>eval</code> blocks inside these subroutines, you should localize <code>$SIG{&#39;__DIE__&#39;}</code> to keep Object::InsideOut&#39;s <code>__DIE__</code> handler from interfering with exceptions generated inside the <code>eval</code> blocks. For example:</p>

<pre><code> sub _init :Init {
     ...
     eval {
         local $SIG{&#39;__DIE__&#39;};
         ...
     };
     if $@ {
         # Handle caught exception
     }
     ...
 }</code></pre>

<p>Here&#39;s another example, where the <code>die</code> function is used as a method of flow control for leaving an <code>eval</code> block:</p>

<pre><code> eval {
     local $SIG{&#39;__DIE__&#39;};           # Suppress any existing __DIE__ handler
     ...
     die({&#39;found&#39; =&gt; 1}) if $found;   # Leave the eval block
     ...
 };
 if ($@) {
     die unless (ref($@) &amp;&amp; $@-&gt;{&#39;found&#39;});   # Propagate any &#39;real&#39; error
     # Handle &#39;found&#39; case
     ...
 }
 # Handle &#39;not found&#39; case</code></pre>

<p>Similarly, if calling code from other modules that use the above flow control mechanism, but without localizing <code>$SIG{&#39;__DIE__&#39;}</code>, you can workaround this deficiency with your own <code>eval</code> block:</p>

<pre><code> eval {
     local $SIG{&#39;__DIE__&#39;};     # Suppress any existing __DIE__ handler
     Some::Module::func();      # Call function that fails to localize
 };
 if ($@) {
     # Handle caught exception
 }</code></pre>

<p>In addition, you should file a bug report against the offending module along with a patch that adds the missing <span style="white-space: nowrap;"><code>local $SIG{&#39;__DIE__&#39;};</code></span> statement.</p>

<h1 id="BUGS-AND-LIMITATIONS"><a id="BUGS"></a>BUGS AND LIMITATIONS</h1>

<p>If you receive an error similar to this:</p>

<pre><code> ERROR: Attempt to DESTROY object ID 1 of class Foo twice</code></pre>

<p>the cause may be that some module used by your application is doing <code>require threads</code> somewhere in the background. <a href="DBI.html">DBI</a> is one such module. The workaround is to add <code>use threads;</code> at the start of your application.</p>

<p>Another cause of the above is returning a non-shared object from a thread either explicitly or implicitly when the result of the last statement in the thread subroutine is an object. For example:</p>

<pre><code> sub thr_func {
     my $obj = MyClass-&gt;new();
 }</code></pre>

<p>which is equivalent to:</p>

<pre><code> sub thr_func {
     return MyClass-&gt;new();
 }</code></pre>

<p>This can be avoided by ensuring your thread subroutine ends with <code>return;</code>.</p>

<p>The equality operator (e.g., <code>if ($obj1 == $obj2) { ...</code>) is overloaded for <code>:SHARED</code> classes when <a href="https://metacpan.org/pod/threads::shared">threads::shared</a> is loaded. The <a href="https://metacpan.org/pod/overload">overload</a> subroutine compares object classes and IDs because references to the same thread shared object may have different refaddrs.</p>

<p>You cannot overload an object to a scalar context (i.e., can&#39;t <code>:SCALARIFY</code>).</p>

<p>You cannot use two instances of the same class with mixed thread object sharing in same application.</p>

<p>Cannot use attributes on <i>subroutine stubs</i> (i.e., forward declaration without later definition) with <code>:Automethod</code>:</p>

<pre><code> package My::Class; {
     sub method :Private;   # Will not work

     sub _automethod :Automethod
     {
         # Code to handle call to &#39;method&#39; stub
     }
 }</code></pre>

<p>Due to limitations in the Perl parser, the entirety of any one attribute must be on a single line. (However, multiple attributes may appear on separate lines.)</p>

<p>If a <i>set</i> accessor accepts scalars, then you can store any inside-out object type in it. If its <code>Type</code> is set to <code>HASH</code>, then it can store any <i>blessed hash</i> object.</p>

<p>Returning objects from threads does not work:</p>

<pre><code> my $obj = threads-&gt;create(sub { return (Foo-&gt;new()); })-&gt;join();  # BAD</code></pre>

<p>Instead, use thread object sharing, create the object before launching the thread, and then manipulate the object inside the thread:</p>

<pre><code> my $obj = Foo-&gt;new();   # Class &#39;Foo&#39; is set &#39;:SHARED&#39;
 threads-&gt;create(sub { $obj-&gt;set_data(&#39;bar&#39;); })-&gt;join();
 my $data = $obj-&gt;get_data();</code></pre>

<p>Due to a limitation in <a href="https://metacpan.org/pod/threads::shared">threads::shared</a> version 1.39 and earlier, if storing shared objects inside other shared objects, you should use <code>delete()</code> to remove them from internal fields (e.g., <code>delete($field[$$self]);</code>) when necessary so that the objects&#39; destructor gets called. Upgrading to version 1.40 or later alleviates most of this issue except during global destruction. See <a href="./Object::InsideOut.html#BUGS-AND-LIMITATIONS">threads::shared</a> for more.</p>

<p>With Perl 5.8.8 and earlier, there are bugs associated with <a href="https://metacpan.org/pod/threads::shared">threads::shared</a> that may prevent you from storing objects inside of shared objects, or using foreign inheritance with shared objects. With Perl 5.8.9 (and later) together with <a href="https://metacpan.org/pod/threads::shared">threads::shared</a> 1.15 (and later), you can store shared objects inside of other shared objects, and you can use foreign inheritance with shared objects (provided the foreign class supports shared objects as well).</p>

<p>Due to internal complexities, the following actions are not supported in code that uses <a href="https://metacpan.org/pod/threads::shared">threads::shared</a> while there are any threads active:</p>

<ul>

<li><p>Runtime loading of Object::InsideOut classes</p>

</li>
<li><p>Using <a href="./Object::InsideOut.html#RUNTIME-INHERITANCE">-&gt;add_class()</a></p>

</li>
</ul>

<p>It is recommended that such activities, if needed, be performed in the main application code before any threads are created (or at least while there are no active threads).</p>

<p>For Perl 5.6.0 through 5.8.0, a Perl bug prevents package variables (e.g., object attribute arrays/hashes) from being referenced properly from subroutine refs returned by an <code>:Automethod</code> subroutine. For Perl 5.8.0 there is no workaround: This bug causes Perl to core dump. For Perl 5.6.0 through 5.6.2, the workaround is to create a ref to the required variable inside the <code>:Automethod</code> subroutine, and use that inside the subroutine ref:</p>

<pre><code> package My::Class; {
     use Object::InsideOut;

     my %data;

     sub auto :Automethod
     {
         my $self = $_[0];
         my $name = $_;

         my $data = \%data;      # Workaround for 5.6.X bug

         return sub {
                     my $self = shift;
                     if (! @_) {
                         return ($$data{$name});
                     }
                     $$data{$name} = shift;
                };
     }
 }</code></pre>

<p>For Perl 5.8.1 through 5.8.4, a Perl bug produces spurious warning messages when threads are destroyed. These messages are innocuous, and can be suppressed by adding the following to your application code:</p>

<pre><code> $SIG{&#39;__WARN__&#39;} = sub {
         if ($_[0] !~ /^Attempt to free unreferenced scalar/) {
             print(STDERR @_);
         }
     };</code></pre>

<p>A better solution would be to upgrade <a href="https://metacpan.org/pod/threads">threads</a> and <a href="https://metacpan.org/pod/threads::shared">threads::shared</a> from CPAN, especially if you encounter other problems associated with threads.</p>

<p>For Perl 5.8.4 and 5.8.5, the <a href="./Object::InsideOut.html#Storable">&quot;Storable&quot;</a> feature does not work due to a Perl bug. Use Object::InsideOut v1.33 if needed.</p>

<p>Due to bugs in the Perl interpreter, using the introspection API (i.e. <code>-&gt;meta()</code>, etc.) requires Perl 5.8.0 or later.</p>

<p>The version of <a href="https://metacpan.org/pod/Want">Want</a> that is available via PPM for ActivePerl is defective, and causes failures when using <code>:lvalue</code> accessors. Remove it, and then download and install the <a href="https://metacpan.org/pod/Want">Want</a> module using CPAN.</p>

<p><a href="https://metacpan.org/pod/Devel::StackTrace">Devel::StackTrace</a> (used by <a href="https://metacpan.org/pod/Exception::Class">Exception::Class</a>) makes use of the <i>DB</i> namespace. As a consequence, Object::InsideOut thinks that <span style="white-space: nowrap;"><code>package DB</code></span> is already loaded. Therefore, if you create a class called <i>DB</i> that is sub-classed by other packages, you may need to <code>require</code> it as follows:</p>

<pre><code> package DB::Sub; {
     require DB;
     use Object::InsideOut qw(DB);
     ...
 }</code></pre>

<p>View existing bug reports at, and submit any new bugs, problems, patches, etc. to: <a href="http://rt.cpan.org/Public/Dist/Display.html?Name=Object-InsideOut">http://rt.cpan.org/Public/Dist/Display.html?Name=Object-InsideOut</a></p>

<h1 id="REQUIREMENTS">REQUIREMENTS</h1>

<dl>

<dt id="Perl-5.6.0-or-later"><a id="Perl"></a>Perl 5.6.0 or later</dt>
<dd>

</dd>
<dt id="Exception::Class-v1.22-or-later"><a id="Exception"></a><a href="https://metacpan.org/pod/Exception::Class">Exception::Class</a> v1.22 or later</dt>
<dd>

</dd>
<dt id="Scalar::Util-v1.10-or-later"><a id="Scalar"></a><a href="https://metacpan.org/pod/Scalar::Util">Scalar::Util</a> v1.10 or later</dt>
<dd>

<p>It is possible to install a <i>pure perl</i> version of Scalar::Util, however, it will be missing the <a href="https://metacpan.org/pod/Scalar::Util#weaken-REF">weaken()</a> function which is needed by Object::InsideOut. You&#39;ll need to upgrade your version of Scalar::Util to one that supports its <code>XS</code> code.</p>

</dd>
<dt id="Test::More-v0.50-or-later"><a id="Test"></a><a href="https://metacpan.org/pod/Test::More">Test::More</a> v0.50 or later</dt>
<dd>

<p>Needed for testing during installation.</p>

</dd>
<dt id="Want-v0.12-or-later"><a id="Want"></a><a href="https://metacpan.org/pod/Want">Want</a> v0.12 or later</dt>
<dd>

<p>Optional. Provides support for <a href="./Object::InsideOut.html#:lvalue-Accessors">&quot;:lvalue Accessors&quot;</a>.</p>

</dd>
<dt id="Math::Random::MT::Auto-v5.04-or-later)"><a id="Math"></a><a id="Math::Random::MT::Auto-v5.04-or-later"></a><a href="https://metacpan.org/pod/Math::Random::MT::Auto">Math::Random::MT::Auto</a> v5.04 or later)</dt>
<dd>

<p>Optional. Provides support for <a href="./Object::InsideOut.html#SECURITY">:SECURE mode</a>.</p>

</dd>
</dl>

<p>To cover all of the above requirements and more, it is recommended that you install <a href="https://metacpan.org/pod/Bundle::Object::InsideOut">Bundle::Object::InsideOut</a> using CPAN:</p>

<pre><code> perl -MCPAN -e &#39;install Bundle::Object::InsideOut&#39;</code></pre>

<p>This will install the latest versions of all the required and optional modules needed for full support of all of the features provided by Object::InsideOut.</p>

<h1 id="SEE-ALSO"><a id="SEE"></a>SEE ALSO</h1>

<p><a href="https://metacpan.org/pod/distribution/Object-InsideOut/lib/Object/InsideOut.pod">Object::InsideOut</a> on MetaCPAN: <a href="https://metacpan.org/release/Object-InsideOut">https://metacpan.org/release/Object-InsideOut</a></p>

<p>Code repository: <a href="https://github.com/jdhedden/Object-InsideOut">https://github.com/jdhedden/Object-InsideOut</a></p>

<p>Inside-out Object Model: <a href="http://www.perlfoundation.org/perl5/index.cgi?inside_out_object">http://www.perlfoundation.org/perl5/index.cgi?inside_out_object</a>, <a href="http://www.perlmonks.org/?node_id=219378">http://www.perlmonks.org/?node_id=219378</a>, <a href="http://www.perlmonks.org/?node_id=483162">http://www.perlmonks.org/?node_id=483162</a>, <a href="http://www.perlmonks.org/?node_id=515650">http://www.perlmonks.org/?node_id=515650</a>, Chapters 15 and 16 of <i>Perl Best Practices</i> by Damian Conway</p>

<p><a href="https://metacpan.org/pod/Object::InsideOut::Metadata">Object::InsideOut::Metadata</a></p>

<p><a href="https://metacpan.org/pod/Storable">Storable</a>, <a>Exception:Class</a>, <a href="https://metacpan.org/pod/Want">Want</a>, <a href="https://metacpan.org/pod/Math::Random::MT::Auto">Math::Random::MT::Auto</a>, <a href="https://metacpan.org/pod/attributes">attributes</a>, <a href="https://metacpan.org/pod/overload">overload</a></p>

<p>Sample code in the <i>examples</i> directory of this distribution on CPAN.</p>

<h1 id="ACKNOWLEDGEMENTS">ACKNOWLEDGEMENTS</h1>

<p>Abigail <span style="white-space: nowrap;">&lt;perl AT abigail DOT nl&gt;</span> for inside-out objects in general.</p>

<p>Damian Conway <span style="white-space: nowrap;">&lt;dconway AT cpan DOT org&gt;</span> for <a href="https://metacpan.org/pod/Class::Std">Class::Std</a>, and for delegator methods.</p>

<p>David A. Golden <span style="white-space: nowrap;">&lt;dagolden AT cpan DOT org&gt;</span> for thread handling for inside-out objects.</p>

<p>Dan Kubb <span style="white-space: nowrap;">&lt;dan.kubb-cpan AT autopilotmarketing DOT com&gt;</span> for <code>:Chained</code> methods.</p>

<h1 id="AUTHOR">AUTHOR</h1>

<p>Jerry D. Hedden, <span style="white-space: nowrap;">&lt;jdhedden AT cpan DOT org&gt;</span></p>

<h1 id="COPYRIGHT-AND-LICENSE"><a id="COPYRIGHT"></a>COPYRIGHT AND LICENSE</h1>

<p>Copyright 2005 - 2012 Jerry D. Hedden. All rights reserved.</p>

<p>This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.</p>

<h1 id="TRANSLATIONS">TRANSLATIONS</h1>

<p>A Japanese translation of this documentation by TSUJII, Naofumi <span style="white-space: nowrap;">&lt;tsun DOT nt AT gmail DOT com&gt;</span> is available at <a href="http://perldoc.jp/docs/modules/">http://perldoc.jp/docs/modules/</a>.</p></div>

<div id="metacpan_install-instructions-dialog" class="modal fade">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title">Module Install Instructions</h4>
      </div>
      <div class="modal-body">
        <p>To install Object::InsideOut, copy and paste the appropriate command in to your terminal.</p>
        <p><a href="https://metacpan.org/dist/App-cpanminus/view/bin/cpanm">cpanm</a></p>
        <pre><code>cpanm Object::InsideOut</code></pre>
        <p><a href="https://metacpan.org/pod/CPAN">CPAN shell</a></p>
        <pre><code>perl -MCPAN -e shell
install Object::InsideOut</code></pre>
        <p>For more information on module installation, please visit <a href="https://www.cpan.org/modules/INSTALL.html">the detailed CPAN module installation guide</a>.</p>
      </div>
      <div class="modal-footer">
        <a href="./Object::InsideOut.html#" data-dismiss="modal" class="btn">Close</a>
      </div>
    </div>
  </div>
</div>
          </main>
          <div class="content-pagination">
          </div>
        </div>
        <footer class="footer">
          <div class="footer-container">
            <div class="footer-social">
              <div class="footer-link footer-logo">
                <a href="https://metacpan.org/">
                  <img src="https://metacpan.org/static/images/metacpan-logo.svg" alt="MetaCPAN" />
                </a>
              </div>
              <a class="footer-social-link" href="https://github.com/metacpan">
                <i class="fab fa-github-square"></i>
              </a>
              <a class="footer-social-link" href="https://fosstodon.org/@metacpan">
                <i class="fab fa-mastodon"></i>
              </a>
            </div>
            <div class="footer-links">
              <div class="footer-link">
                  <a href="https://metacpan.org/about">About</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/about/sponsors">Sponsor</a>
              </div>
              <div class="footer-link">
                  <a href="https://grep.metacpan.org">grep::cpan</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/recent">Recent</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/about/faq">FAQ</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/tools">Tools</a>
              </div>
              <div class="footer-link">
                  <a href="https://fastapi.metacpan.org/">API</a>
              </div>
              <div class="footer-link">
                  <a href="https://www.perl.org/">Perl.org</a>
              </div>
            </div>
            <div class="footer-sponsors">
              <a class="footer-sponsor-link" target="_blank" href="https://www.bytemark.co.uk/" rel="noopener">
                <img class="footer-sponsor-bytemark" src="https://metacpan.org/static/images/sponsors/bytemark_logo.svg" alt="Bytemark logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://www.liquidweb.com/" rel="noopener">
                <img class="footer-sponsor-liquidweb" src="https://metacpan.org/static/images/sponsors/liquidweb_logo.png" alt="liquidweb logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://deriv.com/careers/" rel="noopener">
                <img class="footer-sponsor-deriv" src="https://metacpan.org/static/images/sponsors/deriv.svg" alt="Deriv logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://geocode.xyz" rel="noopener">
                <img class="footer-sponsor-geocode" src="https://metacpan.org/static/images/sponsors/geocodelogo.svg" alt="Geocode logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://www.fastly.com/" rel="noopener">
                <img class="footer-sponsor-fastly" src="https://metacpan.org/static/images/sponsors/fastly_logo.svg" alt="Fastly logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://opencagedata.com" rel="noopener">
                <img class="footer-sponsor-opencage" src="https://metacpan.org/static/images/sponsors/open-cage.svg" alt="OpenCage logo">
              </a>
            </div>
          </div>
        </footer>
        <div class="modal fade" tabindex="-1" role="dialog" id="metacpan_keyboard-shortcuts">
          <div class="modal-dialog">
            <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                <h4 class="modal-title">Keyboard Shortcuts</h4>
              </div>
              <div class="modal-body row">
<div class="col-md-6">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>Global</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>s</kbd>
        </td>
        <td>Focus search bar</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>?</kbd>
        </td>
        <td>Bring up this help dialog</td>
      </tr>
    </tbody>
  </table>

  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>GitHub</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>p</kbd>
        </td>
        <td>Go to pull requests</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>i</kbd>
        </td>
        <td>go to github issues (only if github is preferred repository)</td>
      </tr>
    </tbody>
  </table>
</div>

<div class="col-md-6">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>POD</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>a</kbd>
        </td>
        <td>Go to author</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>c</kbd>
        </td>
        <td>Go to changes</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>i</kbd>
        </td>
        <td>Go to issues</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>d</kbd>
        </td>
        <td>Go to dist</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>r</kbd>
        </td>
        <td>Go to repository/SCM</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>s</kbd>
        </td>
        <td>Go to source</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>b</kbd>
        </td>
        <td>Go to file browse</td>
      </tr>

    </tbody>
  </table>
</div>

<div class="col-md-12">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>Search terms</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><em>module:</em> (e.g. <a href="https://metacpan.org/search?q=module%3APlugin">module:Plugin</a>)</td>
      </tr>
      <tr>
        <td><em>distribution:</em> (e.g. <a href="https://metacpan.org/search?q=distribution%3ADancer+auth">distribution:Dancer auth</a>)</td>
      </tr>
      <tr>
        <td><em>author:</em> (e.g. <a href="https://metacpan.org/search?q=author%3ASONGMU+Redis">author:SONGMU Redis</a>)</td>
      </tr>
      <tr>
        <td><em>version:</em> (e.g. <a href="https://metacpan.org/search?q=version%3A1.00">version:1.00</a>)</td>
      </tr>
    </tbody>
  </table>
</div>
              </div>
              <div class="modal-footer"></div>
            </div>
          </div>
        </div>
    </body>
</html>
